Implement Google+ Sign-In with React Native

前端 未结 3 1236
北荒
北荒 2021-02-13 15:16

I\'m wanting to integrate G+ Sign In (as per https://developers.google.com/+/mobile/ios/sign-in) in a React Native app. I have Facebook Sign In working via http://brentvatne.ca/

3条回答
  •  耶瑟儿~
    2021-02-13 16:02

    So this is only semi-related to React Native, since your main issue seems to be writing the Obj-C side of the G+ sign in. To that end, grab the iOS Quick Start app for Google Plus:

    https://developers.google.com/+/quickstart/ios

    Follow the instructions to open the sample project and you'll find the SignInViewController.m file which contains this line:

    @interface SignInViewController () 
    

    That appears to be what you're after.

    Once you have that working, you'll need to implement the connection to React Native. The Facebook post you linked to shows how to do that, but the official documentation is here:

    http://facebook.github.io/react-native/docs/nativemodulesios.html#content

    I also wrote a post to show the simplest Native Module I could think of, which I think describes the general concept pretty well:

    http://colinramsay.co.uk/2015/03/27/react-native-simple-native-module.html

提交回复
热议问题