HomeiOS DevelopmentLogin with twitter utilizing react-native-twitter-signin in react-native for IOS however after profitable...

Login with twitter utilizing react-native-twitter-signin in react-native for IOS however after profitable authentication not redirecting again to app


``import React, {useState} from 'react';
import {View, NativeModules, TouchableOpacity, Picture} from 'react-native';
import twitter from '../../property/pictures/twitter.png';
import {kinds} from './kinds/SsoLogin';

const {RNTwitterSignIn} = NativeModules;

const TwitterLogin = () => {
  const [isLoading, setIsLoading] = useState(false);
  const TWITTER_CONSUMER_KEY = 'my shopper key';
  const TWITTER_CONSUMER_SECRET =
    'my secret key';

  const handleTwitterLogin = async () => {
    setIsLoading(true);
    RNTwitterSignIn.init(TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET);
    attempt {
      const {authToken, e mail} = await RNTwitterSignIn.logIn();
      console.log('sure', authToken);
      console.log('consumer e mail', e mail);
      setIsLoading(false);
    } catch (error) {
      console.log('sure error', error);
      setIsLoading(false);
    }
  };

  return (
    <View>
      <TouchableOpacity fashion={kinds.buttonStyle} onPress={handleTwitterLogin}>
        <Picture fashion={{peak: 22, width: 22}} supply={twitter} />
      </TouchableOpacity>
    </View>
  );
};

export default TwitterLogin;

- (BOOL)utility:(UIApplication *)app openURL:(NSURL *)url choices:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)choices {
  return [RCTLinkingManager application:app openURL:url options:options];
}
`

Login with twitter utilizing react-native-twitter-signin in react-native for IOS however after profitable authentication not redirecting again to app.
After profitable auth redirect again to my app.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments