Skip to content
This repository has been archived by the owner on Apr 2, 2021. It is now read-only.

Commit

Permalink
Integrate latest FBSDK on iOS and JS (#541)
Browse files Browse the repository at this point in the history
There have been some breaking changes in the native FBSDK this year which prevents us from using the latest version. I've decided to help the problem and integrate the latest changes with this pull request.

Currently I've integrated the iOS FBSDK changes. My app builds and runs and I was able to login and obtain an access token. I'm not finished with these integrations.

Here are the list of things I want to do:

- double check iOS FBSDK changes to make sure I've got everything
- integrate Android FBSDK similarly
- document all the changes I've made
- test all the affected features

After I've done with these items this PR should be ready for a real review and consideration to merge it and support the latest FBSDK on both platforms.

It would be great if you could try this out and confirm that it works for you too. Everything should work on iOS.

I've started my branch from the latest published version which is `0.9.0`. I did this on purpose because `master` is broken currently due to `RCTComponentEvent` still being unpublished.

Your feedback would be greatly appreciated. 🙂

**[Update-2019-June-14]** This PR has been repurposed into integrating the latest FBSDK on iOS and JS only. The android part has been done in PR #546 

Fixes #533
  • Loading branch information
redcancode authored and janicduplessis committed Jun 14, 2019
1 parent 71053fe commit 628b55a
Show file tree
Hide file tree
Showing 25 changed files with 117 additions and 641 deletions.
4 changes: 0 additions & 4 deletions example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,5 @@ target 'RNFBSDKExample' do
pod 'glog', :podspec => '../../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../../node_modules/react-native/third-party-podspecs/Folly.podspec'

pod 'FBSDKCoreKit', '~> 4.0'
pod 'FBSDKLoginKit', '~> 4.0'
pod 'FBSDKShareKit', '~> 4.0'

pod 'react-native-fbsdk', :path => '../../'
end
83 changes: 38 additions & 45 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
PODS:
- Bolts (1.9.0):
- Bolts/AppLinks (= 1.9.0)
- Bolts/Tasks (= 1.9.0)
- Bolts/AppLinks (1.9.0):
- Bolts/Tasks
- Bolts/Tasks (1.9.0)
- boost-for-react-native (1.63.0)
- DoubleConversion (1.1.6)
- FBSDKCoreKit (4.44.1):
- Bolts (~> 1.9)
- FBSDKLoginKit (4.44.1):
- FBSDKCoreKit
- FBSDKShareKit (4.44.1):
- FBSDKCoreKit
- FBSDKCoreKit (5.0.2):
- FBSDKCoreKit/Basics (= 5.0.2)
- FBSDKCoreKit/Core (= 5.0.2)
- FBSDKCoreKit/Basics (5.0.2)
- FBSDKCoreKit/Core (5.0.2):
- FBSDKCoreKit/Basics
- FBSDKLoginKit (5.0.2):
- FBSDKCoreKit (~> 5.0)
- FBSDKShareKit (5.0.2):
- FBSDKCoreKit (~> 5.0)
- Folly (2018.10.22.00):
- boost-for-react-native
- DoubleConversion
Expand Down Expand Up @@ -75,13 +73,13 @@ PODS:
- react-native-fbsdk/Login (= 0.9.0)
- react-native-fbsdk/Share (= 0.9.0)
- react-native-fbsdk/Core (0.9.0):
- FBSDKCoreKit
- FBSDKCoreKit (~> 5.0.0)
- React
- react-native-fbsdk/Login (0.9.0):
- FBSDKLoginKit
- FBSDKLoginKit (~> 5.0.0)
- React
- react-native-fbsdk/Share (0.9.0):
- FBSDKShareKit
- FBSDKShareKit (~> 5.0.0)
- React
- React-RCTActionSheet (0.60.0-rc.1):
- React-Core (= 0.60.0-rc.1)
Expand Down Expand Up @@ -111,9 +109,6 @@ PODS:

DEPENDENCIES:
- DoubleConversion (from `../../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
- FBSDKCoreKit (~> 4.0)
- FBSDKLoginKit (~> 4.0)
- FBSDKShareKit (~> 4.0)
- Folly (from `../../node_modules/react-native/third-party-podspecs/Folly.podspec`)
- glog (from `../../node_modules/react-native/third-party-podspecs/glog.podspec`)
- React (from `../../node_modules/react-native/`)
Expand All @@ -139,7 +134,6 @@ DEPENDENCIES:

SPEC REPOS:
https://github.com/cocoapods/specs.git:
- Bolts
- boost-for-react-native
- FBSDKCoreKit
- FBSDKLoginKit
Expand Down Expand Up @@ -194,35 +188,34 @@ EXTERNAL SOURCES:
:path: "../../node_modules/react-native/ReactCommon/yoga"

SPEC CHECKSUMS:
Bolts: ac6567323eac61e203f6a9763667d0f711be34c8
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2
FBSDKCoreKit: a823ae35bdb60ebb8d7a7e51abe7c5d87d2bfced
FBSDKLoginKit: 54ae59987f2a8703021557c90a9aebb9e5c2bef6
FBSDKShareKit: 526d4cfb713d24855fa23d0dd74e191accd3a720
FBSDKCoreKit: 3e41c402eb64ea7799c71833ff9e5690f27b9c42
FBSDKLoginKit: a88f36da648e4c5d60eb261c63eac067abb97130
FBSDKShareKit: 8695bbb97c18a381bbf2851a3f24f95a59121b82
Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51
glog: 1f3da668190260b06b429bb211bfbee5cd790c28
React: 771da41f95c2938a4268d0064dae874efca76d47
React-Core: c6be9e64310cda9bded86059005a2be9cfcd83d1
React-cxxreact: 17ab2493f0071b3587a2fa8874d374ab6df17d91
React-DevSupport: e47afce62e4d32d81df53ec593bf490101954c63
React-fishhook: 689293b246ac0d2aa2aae7bac08719d69ff4b6db
React-jsi: 6d2a594ad2281e6646fa3ac665b95554d0e3c0b1
React-jsiexecutor: 418cedeadc8ae5096574e6b199a6b025734397d5
React-jsinspector: 3d54eec4e664fad1fe6ecf3fb2554b53d379fb9f
react-native-fbsdk: 1f3653582707ed39611007d85ffafdc44833aa48
React-RCTActionSheet: 37f59304f286148e9bf0fdd8683e6d959998bd58
React-RCTAnimation: 43948fbaed6ac32285130d0bf6543d685d271d01
React-RCTBlob: f7614a4b3631c8c0048516972cb48ab21e3229f7
React-RCTImage: 0af567e4ecc3fe76469ccd93e25f8403aa953917
React-RCTLinking: c26bd5665a0226654e7d33f674bb0083a5f8822b
React-RCTNetwork: 467aab0787fb8d940be0767de88f18c6d3fbda24
React-RCTSettings: 79d28ecf44cf144432c1001bbca2e93d4d7a4e7f
React-RCTText: 1b3e71979b7de522c797d5c437107897f0f8aa48
React-RCTVibration: d3a10d7c6c55df9021432a0a33507331757a302b
React-RCTWebSocket: ea37aa224c6c3dab458b142c0d17c42b3f80e989
yoga: 6cc9ed1b0509efe6b6519dc5f44af3c7b9dfb7a5
React: c438ccc7e14e86d4702bb92d7e262f549ffaa995
React-Core: c76495f5c14e73c0f803b89c3fa83f804da61bd6
React-cxxreact: f64bc64cf4682d6ea5a064f6017da72482858682
React-DevSupport: 30336bca00f72681eac995d21a31b963e7d5cfec
React-fishhook: 73dc8058ca42828cc92e8fbba6cd9571100e10ca
React-jsi: 40f467ff088c811c6630acccb4aea57ea7ccb1b5
React-jsiexecutor: e4b4717060a0cd8d0270323b5655a68c95432efd
React-jsinspector: 044105eea064aec81adc5e4d777a8f6589e7d094
react-native-fbsdk: 73370971d27ac3c73716e9431093e1a4388289cc
React-RCTActionSheet: 08864c609d9f959abf3d51fdd93f8bc6e91f21eb
React-RCTAnimation: a4547e9fac2627ded3df9d302f5558b475faf819
React-RCTBlob: 62d5c263a2adb8f7a2cafd601beba18a2d99cbbb
React-RCTImage: 963859de2b05d2037d1b7842cdbddc8d7f3a2f3b
React-RCTLinking: 5998a7db9a6156ed112b006d01f76b2d1cc83d98
React-RCTNetwork: 0b676e8194f3f893db813007d37e37e9820173a3
React-RCTSettings: fdd7606f1b6050eced69fc6046d5db6768aefd57
React-RCTText: 36c0532feb5521cb295ba80e7e44b70cf1c36fc7
React-RCTVibration: dabb8d59bb47e1d9124b3f77bfdc1b33d42b0a74
React-RCTWebSocket: f32b93e0953d7c07fd5dd45305406282cfdc95cf
yoga: 88c514f310aff89b94a14c5fbf44b95735af0cb7

PODFILE CHECKSUM: 5828b1e7c5245e771ab7714ab62b40e005620e62
PODFILE CHECKSUM: 166764d2c07190c305e293455e6e35c162854eb0

COCOAPODS: 1.6.1
COCOAPODS: 1.5.3
12 changes: 8 additions & 4 deletions example/ios/RNFBSDKExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = RNFBSDKExample/Images.xcassets; sourceTree = "<group>"; };
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = RNFBSDKExample/Info.plist; sourceTree = "<group>"; };
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = RNFBSDKExample/main.m; sourceTree = "<group>"; };
249908D268DE98AF24F835A1 /* Pods-RNFBSDKExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNFBSDKExample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RNFBSDKExample/Pods-RNFBSDKExample.debug.xcconfig"; sourceTree = "<group>"; };
2D16E6891FA4F8E400B85C8A /* libReact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libReact.a; sourceTree = BUILT_PRODUCTS_DIR; };
870A7DD6F7C14CB1ADF66F14 /* libPods-RNFBSDKExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNFBSDKExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
B8B51A8B9E573C31AA602BB8 /* Pods-RNFBSDKExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNFBSDKExample.debug.xcconfig"; path = "Target Support Files/Pods-RNFBSDKExample/Pods-RNFBSDKExample.debug.xcconfig"; sourceTree = "<group>"; };
C91B992100F02D057FFBC015 /* Pods-RNFBSDKExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNFBSDKExample.release.xcconfig"; path = "Pods/Target Support Files/Pods-RNFBSDKExample/Pods-RNFBSDKExample.release.xcconfig"; sourceTree = "<group>"; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; };
/* End PBXFileReference section */
Expand Down Expand Up @@ -73,6 +75,8 @@
children = (
B8B51A8B9E573C31AA602BB8 /* Pods-RNFBSDKExample.debug.xcconfig */,
0EF5B78486F2856ACDCEA373 /* Pods-RNFBSDKExample.release.xcconfig */,
249908D268DE98AF24F835A1 /* Pods-RNFBSDKExample.debug.xcconfig */,
C91B992100F02D057FFBC015 /* Pods-RNFBSDKExample.release.xcconfig */,
);
name = Pods;
path = Pods;
Expand Down Expand Up @@ -185,7 +189,7 @@
inputFileListPaths = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-RNFBSDKExample/Pods-RNFBSDKExample-resources.sh",
"${SRCROOT}/Pods/Target Support Files/Pods-RNFBSDKExample/Pods-RNFBSDKExample-resources.sh",
"${PODS_ROOT}/FBSDKCoreKit/FacebookSDKStrings.bundle",
);
name = "[CP] Copy Pods Resources";
Expand All @@ -196,7 +200,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNFBSDKExample/Pods-RNFBSDKExample-resources.sh\"\n";
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-RNFBSDKExample/Pods-RNFBSDKExample-resources.sh\"\n";
showEnvVarsInLog = 0;
};
E3AE85C98B0DE57952EBBE93 /* [CP] Check Pods Manifest.lock */ = {
Expand Down Expand Up @@ -250,7 +254,7 @@
/* Begin XCBuildConfiguration section */
13B07F941A680F5B00A75B9A /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = B8B51A8B9E573C31AA602BB8 /* Pods-RNFBSDKExample.debug.xcconfig */;
baseConfigurationReference = 249908D268DE98AF24F835A1 /* Pods-RNFBSDKExample.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = 1;
Expand All @@ -270,7 +274,7 @@
};
13B07F951A680F5B00A75B9A /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 0EF5B78486F2856ACDCEA373 /* Pods-RNFBSDKExample.release.xcconfig */;
baseConfigurationReference = C91B992100F02D057FFBC015 /* Pods-RNFBSDKExample.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = 1;
Expand Down
12 changes: 0 additions & 12 deletions ios/RCTFBSDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
93E004F01CE3D2B4000598E3 /* RCTFBSDKLoginButtonManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 93E004EC1CE3D2B4000598E3 /* RCTFBSDKLoginButtonManager.m */; };
93E004F11CE3D2B4000598E3 /* RCTFBSDKLoginManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 93E004EE1CE3D2B4000598E3 /* RCTFBSDKLoginManager.m */; };
93E0050B1CE3D2D3000598E3 /* RCTConvert+FBSDKSharingContent.m in Sources */ = {isa = PBXBuildFile; fileRef = 93E004F41CE3D2D3000598E3 /* RCTConvert+FBSDKSharingContent.m */; };
93E0050E1CE3D2D3000598E3 /* RCTFBSDKAppInviteDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = 93E004FA1CE3D2D3000598E3 /* RCTFBSDKAppInviteDialog.m */; };
93E0050F1CE3D2D3000598E3 /* RCTFBSDKGameRequestDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = 93E004FC1CE3D2D3000598E3 /* RCTFBSDKGameRequestDialog.m */; };
93E005101CE3D2D3000598E3 /* RCTFBSDKLikeControlManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 93E004FE1CE3D2D3000598E3 /* RCTFBSDKLikeControlManager.m */; };
93E005111CE3D2D3000598E3 /* RCTFBSDKMessageDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = 93E005001CE3D2D3000598E3 /* RCTFBSDKMessageDialog.m */; };
93E005121CE3D2D3000598E3 /* RCTFBSDKSendButtonManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 93E005021CE3D2D3000598E3 /* RCTFBSDKSendButtonManager.m */; };
93E005131CE3D2D3000598E3 /* RCTFBSDKShareAPI.m in Sources */ = {isa = PBXBuildFile; fileRef = 93E005041CE3D2D3000598E3 /* RCTFBSDKShareAPI.m */; };
Expand Down Expand Up @@ -66,12 +64,8 @@
93E004EE1CE3D2B4000598E3 /* RCTFBSDKLoginManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RCTFBSDKLoginManager.m; path = login/RCTFBSDKLoginManager.m; sourceTree = "<group>"; };
93E004F31CE3D2D3000598E3 /* RCTConvert+FBSDKSharingContent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "RCTConvert+FBSDKSharingContent.h"; path = "share/RCTConvert+FBSDKSharingContent.h"; sourceTree = "<group>"; };
93E004F41CE3D2D3000598E3 /* RCTConvert+FBSDKSharingContent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "RCTConvert+FBSDKSharingContent.m"; path = "share/RCTConvert+FBSDKSharingContent.m"; sourceTree = "<group>"; };
93E004F91CE3D2D3000598E3 /* RCTFBSDKAppInviteDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RCTFBSDKAppInviteDialog.h; path = share/RCTFBSDKAppInviteDialog.h; sourceTree = "<group>"; };
93E004FA1CE3D2D3000598E3 /* RCTFBSDKAppInviteDialog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RCTFBSDKAppInviteDialog.m; path = share/RCTFBSDKAppInviteDialog.m; sourceTree = "<group>"; };
93E004FB1CE3D2D3000598E3 /* RCTFBSDKGameRequestDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RCTFBSDKGameRequestDialog.h; path = share/RCTFBSDKGameRequestDialog.h; sourceTree = "<group>"; };
93E004FC1CE3D2D3000598E3 /* RCTFBSDKGameRequestDialog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RCTFBSDKGameRequestDialog.m; path = share/RCTFBSDKGameRequestDialog.m; sourceTree = "<group>"; };
93E004FD1CE3D2D3000598E3 /* RCTFBSDKLikeControlManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RCTFBSDKLikeControlManager.h; path = share/RCTFBSDKLikeControlManager.h; sourceTree = "<group>"; };
93E004FE1CE3D2D3000598E3 /* RCTFBSDKLikeControlManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RCTFBSDKLikeControlManager.m; path = share/RCTFBSDKLikeControlManager.m; sourceTree = "<group>"; };
93E004FF1CE3D2D3000598E3 /* RCTFBSDKMessageDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RCTFBSDKMessageDialog.h; path = share/RCTFBSDKMessageDialog.h; sourceTree = "<group>"; };
93E005001CE3D2D3000598E3 /* RCTFBSDKMessageDialog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RCTFBSDKMessageDialog.m; path = share/RCTFBSDKMessageDialog.m; sourceTree = "<group>"; };
93E005011CE3D2D3000598E3 /* RCTFBSDKSendButtonManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RCTFBSDKSendButtonManager.h; path = share/RCTFBSDKSendButtonManager.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -174,12 +168,8 @@
children = (
93E004F31CE3D2D3000598E3 /* RCTConvert+FBSDKSharingContent.h */,
93E004F41CE3D2D3000598E3 /* RCTConvert+FBSDKSharingContent.m */,
93E004F91CE3D2D3000598E3 /* RCTFBSDKAppInviteDialog.h */,
93E004FA1CE3D2D3000598E3 /* RCTFBSDKAppInviteDialog.m */,
93E004FB1CE3D2D3000598E3 /* RCTFBSDKGameRequestDialog.h */,
93E004FC1CE3D2D3000598E3 /* RCTFBSDKGameRequestDialog.m */,
93E004FD1CE3D2D3000598E3 /* RCTFBSDKLikeControlManager.h */,
93E004FE1CE3D2D3000598E3 /* RCTFBSDKLikeControlManager.m */,
93E004FF1CE3D2D3000598E3 /* RCTFBSDKMessageDialog.h */,
93E005001CE3D2D3000598E3 /* RCTFBSDKMessageDialog.m */,
93E005011CE3D2D3000598E3 /* RCTFBSDKSendButtonManager.h */,
Expand Down Expand Up @@ -262,9 +252,7 @@
93E005311CE3D63D000598E3 /* RCTFBSDKInitializer.m in Sources */,
93E004E31CE3D292000598E3 /* RCTConvert+FBSDKAccessToken.m in Sources */,
93E004F01CE3D2B4000598E3 /* RCTFBSDKLoginButtonManager.m in Sources */,
93E0050E1CE3D2D3000598E3 /* RCTFBSDKAppInviteDialog.m in Sources */,
93E004EF1CE3D2B4000598E3 /* RCTConvert+FBSDKLogin.m in Sources */,
93E005101CE3D2D3000598E3 /* RCTFBSDKLikeControlManager.m in Sources */,
93E005161CE3D2D3000598E3 /* RCTFBSDKShareHelper.m in Sources */,
93E005141CE3D2D3000598E3 /* RCTFBSDKShareButtonManager.m in Sources */,
93E005131CE3D2D3000598E3 /* RCTFBSDKShareAPI.m in Sources */,
Expand Down
4 changes: 3 additions & 1 deletion ios/RCTFBSDK/core/RCTConvert+FBSDKAccessToken.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ + (FBSDKAccessToken *)FBSDKAccessToken:(id)json
initWithTokenString:[RCTConvert NSString:data[@"accessToken"]]
permissions:[RCTConvert NSStringArray:data[@"permissions"]]
declinedPermissions:[RCTConvert NSStringArray:data[@"declinedPermissions"]]
expiredPermissions:[RCTConvert NSStringArray:data[@"expiredPermissions"]]
appID:[RCTConvert NSString:data[@"applicationID"]]
userID:[RCTConvert NSString:data[@"userID"]]
expirationDate:[RCTConvert NSDate:data[@"expirationTime"]]
refreshDate:[RCTConvert NSDate:data[@"lastRefreshTime"]]];
refreshDate:[RCTConvert NSDate:data[@"lastRefreshTime"]]
dataAccessExpirationDate:[RCTConvert NSDate:data[@"dataAccessExpirationTime"]]];
}
return nil;
}
Expand Down
6 changes: 4 additions & 2 deletions ios/RCTFBSDK/core/RCTFBSDKAccessToken.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,14 @@ - (dispatch_queue_t)methodQueue
}
return @{
@"accessToken": token.tokenString,
@"applicationID": token.appID,
@"userID": token.userID,
@"permissions": token.permissions.allObjects,
@"declinedPermissions": token.declinedPermissions.allObjects,
@"expiredPermissions": token.expiredPermissions.allObjects,
@"applicationID": token.appID,
@"userID": token.userID,
@"expirationTime": @(token.expirationDate.timeIntervalSince1970 * 1000),
@"lastRefreshTime": @(token.refreshDate.timeIntervalSince1970 * 1000),
@"dataAccessExpirationTime": @(token.dataAccessExpirationDate.timeIntervalSince1970 * 1000),
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ - (void)start
g_pendingConnection = [[NSMutableArray alloc] init];
[g_pendingConnection addObject:self];
for (int i = 0; i < _requestBatch.count; i++) {
FBSDKGraphRequestHandler completionHandler = ^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
FBSDKGraphRequestBlock completionHandler = ^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
NSDictionary *errorDict = error ? RCTJSErrorFromNSError(error) : nil;
_response[[NSString stringWithFormat: @"%i", i]] = @[RCTNullIfNil(errorDict), RCTNullIfNil(result)];
};
Expand Down
5 changes: 1 addition & 4 deletions ios/RCTFBSDK/login/RCTConvert+FBSDKLogin.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@
@implementation RCTConvert(FBSDKLogin)

RCT_ENUM_CONVERTER(FBSDKLoginBehavior, (@{
@"native": @(FBSDKLoginBehaviorNative),
@"browser": @(FBSDKLoginBehaviorBrowser),
@"system_account": @(FBSDKLoginBehaviorSystemAccount),
@"web": @(FBSDKLoginBehaviorWeb),
}), FBSDKLoginBehaviorNative, unsignedLongValue)
}), FBSDKLoginBehaviorBrowser, unsignedLongValue)

RCT_ENUM_CONVERTER(FBSDKDefaultAudience, (@{
@"friends": @(FBSDKDefaultAudienceFriends),
Expand Down
2 changes: 1 addition & 1 deletion ios/RCTFBSDK/login/RCTFBSDKLoginButtonManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ - (UIView *)view

RCT_CUSTOM_VIEW_PROPERTY(loginBehaviorIOS, FBSDKLoginBehavior, FBSDKLoginButton)
{
[view setLoginBehavior:json ? [RCTConvert FBSDKLoginBehavior:json] : FBSDKLoginBehaviorNative];
[view setLoginBehavior:json ? [RCTConvert FBSDKLoginBehavior:json] : FBSDKLoginBehaviorBrowser];
}

RCT_EXPORT_VIEW_PROPERTY(defaultAudience, FBSDKDefaultAudience)
Expand Down
Loading

0 comments on commit 628b55a

Please sign in to comment.