Skip to content

Commit 2d7478d

Browse files
committed
Merge pull request #1 from wuzhiming/plugin_fb
feature #5592 add Facebook to pluginX
2 parents 6a8329c + 6681069 commit 2d7478d

File tree

3 files changed

+55
-6
lines changed

3 files changed

+55
-6
lines changed

build/cocos2d_jsb_samples.xcodeproj/project.pbxproj

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
05DB07CA195AD08600AFE6CE /* libPluginFacebook.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BA1BF835195A6C7E00B47F4E /* libPluginFacebook.a */; };
11+
05DB07D1195AD30800AFE6CE /* FacebookSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 05DB07D0195AD30800AFE6CE /* FacebookSDK.framework */; };
1012
05F48C13192C9178008FB408 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 05F48C12192C9178008FB408 /* Security.framework */; };
1113
05F48C15192C9180008FB408 /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 05F48C14192C9180008FB408 /* CoreTelephony.framework */; };
1214
1A2B735018D2952200ED9E74 /* libchipmunk Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A604F1618BF1D1D00CC9A93 /* libchipmunk Mac.a */; };
@@ -148,6 +150,13 @@
148150
/* End PBXBuildFile section */
149151

150152
/* Begin PBXContainerItemProxy section */
153+
05DB07C8195AD08600AFE6CE /* PBXContainerItemProxy */ = {
154+
isa = PBXContainerItemProxy;
155+
containerPortal = BA1BF830195A6C7E00B47F4E /* PluginFacebook.xcodeproj */;
156+
proxyType = 2;
157+
remoteGlobalIDString = BA34A76D195AA8C7002D0ECD;
158+
remoteInfo = PluginFacebookTests;
159+
};
151160
1A2B732018D2952200ED9E74 /* PBXContainerItemProxy */ = {
152161
isa = PBXContainerItemProxy;
153162
containerPortal = 1A604F2518BF1D2000CC9A93 /* cocos2d_js_bindings.xcodeproj */;
@@ -473,6 +482,7 @@
473482
/* End PBXContainerItemProxy section */
474483

475484
/* Begin PBXFileReference section */
485+
05DB07D0195AD30800AFE6CE /* FacebookSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FacebookSDK.framework; path = "../frameworks/js-bindings/cocos2d-x/plugin/plugins/facebook/proj.ios/sdk/FacebookSDK.framework"; sourceTree = "<group>"; };
476486
05F48C12192C9178008FB408 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; };
477487
05F48C14192C9180008FB408 /* CoreTelephony.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/CoreTelephony.framework; sourceTree = DEVELOPER_DIR; };
478488
15C64822165F391E007D4F18 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Cocoa.framework; sourceTree = DEVELOPER_DIR; };
@@ -624,6 +634,8 @@
624634
isa = PBXFrameworksBuildPhase;
625635
buildActionMask = 2147483647;
626636
files = (
637+
05DB07D1195AD30800AFE6CE /* FacebookSDK.framework in Frameworks */,
638+
05DB07CA195AD08600AFE6CE /* libPluginFacebook.a in Frameworks */,
627639
BA623E1F191A220B00761F37 /* StoreKit.framework in Frameworks */,
628640
05F48C15192C9180008FB408 /* CoreTelephony.framework in Frameworks */,
629641
05F48C13192C9178008FB408 /* Security.framework in Frameworks */,
@@ -881,6 +893,7 @@
881893
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
882894
isa = PBXGroup;
883895
children = (
896+
05DB07D0195AD30800AFE6CE /* FacebookSDK.framework */,
884897
05F48C14192C9180008FB408 /* CoreTelephony.framework */,
885898
05F48C12192C9178008FB408 /* Security.framework */,
886899
BA623E24191A221D00761F37 /* MediaPlayer.framework */,
@@ -911,7 +924,8 @@
911924
BA1BF831195A6C7E00B47F4E /* Products */ = {
912925
isa = PBXGroup;
913926
children = (
914-
BA1BF835195A6C7E00B47F4E /* libPluginFacebook.dylib */,
927+
BA1BF835195A6C7E00B47F4E /* libPluginFacebook.a */,
928+
05DB07C9195AD08600AFE6CE /* PluginFacebookTests.xctest */,
915929
);
916930
name = Products;
917931
sourceTree = "<group>";
@@ -1163,6 +1177,13 @@
11631177
/* End PBXProject section */
11641178

11651179
/* Begin PBXReferenceProxy section */
1180+
05DB07C9195AD08600AFE6CE /* PluginFacebookTests.xctest */ = {
1181+
isa = PBXReferenceProxy;
1182+
fileType = wrapper.cfbundle;
1183+
path = PluginFacebookTests.xctest;
1184+
remoteRef = 05DB07C8195AD08600AFE6CE /* PBXContainerItemProxy */;
1185+
sourceTree = BUILT_PRODUCTS_DIR;
1186+
};
11661187
1A604F1218BF1D1D00CC9A93 /* libcocos2dx Mac.a */ = {
11671188
isa = PBXReferenceProxy;
11681189
fileType = archive.ar;
@@ -1254,10 +1275,10 @@
12541275
remoteRef = BA1BF81C195A6A7400B47F4E /* PBXContainerItemProxy */;
12551276
sourceTree = BUILT_PRODUCTS_DIR;
12561277
};
1257-
BA1BF835195A6C7E00B47F4E /* libPluginFacebook.dylib */ = {
1278+
BA1BF835195A6C7E00B47F4E /* libPluginFacebook.a */ = {
12581279
isa = PBXReferenceProxy;
1259-
fileType = "compiled.mach-o.dylib";
1260-
path = libPluginFacebook.dylib;
1280+
fileType = archive.ar;
1281+
path = libPluginFacebook.a;
12611282
remoteRef = BA1BF834195A6C7E00B47F4E /* PBXContainerItemProxy */;
12621283
sourceTree = BUILT_PRODUCTS_DIR;
12631284
};
@@ -1702,6 +1723,10 @@
17021723
CODE_SIGN_IDENTITY = "iPhone Developer";
17031724
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
17041725
COMPRESS_PNG_FILES = NO;
1726+
FRAMEWORK_SEARCH_PATHS = (
1727+
"$(inherited)",
1728+
"/Users/wzm/Documents/software/tomcat/webapps/cocos2d-js-clean/frameworks/js-bindings/cocos2d-x/plugin/plugins/facebook/proj.ios/sdk",
1729+
);
17051730
GCC_DYNAMIC_NO_PIC = NO;
17061731
GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
17071732
GCC_PRECOMPILE_PREFIX_HEADER = YES;
@@ -1730,6 +1755,10 @@
17301755
CODE_SIGN_IDENTITY = "iPhone Developer";
17311756
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
17321757
COMPRESS_PNG_FILES = NO;
1758+
FRAMEWORK_SEARCH_PATHS = (
1759+
"$(inherited)",
1760+
"/Users/wzm/Documents/software/tomcat/webapps/cocos2d-js-clean/frameworks/js-bindings/cocos2d-x/plugin/plugins/facebook/proj.ios/sdk",
1761+
);
17331762
GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
17341763
GCC_PRECOMPILE_PREFIX_HEADER = YES;
17351764
GCC_PREPROCESSOR_DEFINITIONS = (

samples/js-tests/project/proj.ios/AppController.mm

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ of this software and associated documentation files (the "Software"), to deal
3030
#import "AppDelegate.h"
3131
#import "RootViewController.h"
3232
#import "CCEAGLView.h"
33+
#import <FacebookSDK/FacebookSDK.h>
3334

3435
@implementation AppController
3536

@@ -98,6 +99,7 @@ - (void)applicationDidBecomeActive:(UIApplication *)application {
9899
/*
99100
Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
100101
*/
102+
[FBAppCall handleDidBecomeActive];
101103
cocos2d::Director::getInstance()->resume();
102104
}
103105

@@ -138,7 +140,12 @@ Free up as much memory as possible by purging cached data objects that can be re
138140
- (void)dealloc {
139141
[super dealloc];
140142
}
141-
142-
143+
- (BOOL)application:(UIApplication *)application
144+
openURL:(NSURL *)url
145+
sourceApplication:(NSString *)sourceApplication
146+
annotation:(id)annotation
147+
{
148+
return [FBSession.activeSession handleOpenURL:url];
149+
}
143150
@end
144151

samples/js-tests/project/proj.ios/Info.plist

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5+
<key>CFBundleURLTypes</key>
6+
<array>
7+
<dict>
8+
<key>CFBundleURLSchemes</key>
9+
<array>
10+
<string>fb1426774790893461</string>
11+
</array>
12+
</dict>
13+
</array>
14+
<key>FacebookDisplayName</key>
15+
<string>myFc</string>
16+
<key>FacebookAppID</key>
17+
<string>1426774790893461</string>
518
<key>CFBundleDevelopmentRegion</key>
619
<string>English</string>
720
<key>CFBundleDisplayName</key>

0 commit comments

Comments
 (0)