iOS

教學

1.加上 firebase 程式,然後跟著步驟

2. podFile 加上

pod 'Firebase/Analytics'
pod 'GoogleSignIn', '~> 5.0.2'

然後pod install

3.修改 xcode

4.修改 AppDelegate.m

// AppDelegate.m
- (BOOL)application:(UIApplication *)application openURL:(nonnull NSURL *)url options:(nonnull NSDictionary<NSString *,id> *)options {
  return [[FBSDKApplicationDelegate sharedInstance] application:application openURL:url options:options] || [RNGoogleSignin application:application openURL:url options:options];
}

範例:

GoogleSignin.configure({
  iosClientId:
    '1795445603utvtntu93ui.apps.googleusercontent.com',
});

// iosClientId 把 GoogleService-Info 這段貼上
// <key>CLIENT_ID</key>
// <string>.....</string>

Last updated