How to get myapp: // url to work with Instagram API redirect uri

I am new to mobile app development.

I have an Instagram authentication application.

My URL scheme is working. When I open Safari and type myapp://, it opens the application.

When I try to add myapp://forwarding URLs in the Instagram API, this leads to errors and says Enter a valid website.

How do I get the redirect url to work? What should I have as a URI redirect for Instagrams?

Thanks in advance.

+4
source share
1 answer

, ios, android, android url : http://myApp AndroidManifest.xml, URL- instagram https://www.instagram.com/developer/

ios - : http//myApp://, , URL- instagram

, :

  • Linking api -native, Instagram ;
  • URL- access_token, : http://myApp/#access_token=asa2dcc...'


, , . :

  • , WebView api -native, Linking; , , - , , .
  • URL- ios instagram/developer, , ,
  • prop, url access_token, api
  • -, WebView, , , turn api:

    navigation.navigate('InstaWebView', {
      callback: (err, access_token) => {
        if (!access_token) { 
          return Alert.alert('Error in fetching insta token');
        }
        // make api calls
      },
    }); 
    


  • InstaWebView, WebView :

    <WebView
          ref={WEBVIEW_REF}
          style={{ flex: 1 }}
          onNavigationStateChange={
              this.onNavigationStateChange.bind(this)
          }
          source={{ uri: instaUrl }}
          onError={() => {
            Alert.alert('Error in loading WebView..Please try again');
            return navigation.goBack();
          }}
        /> 
    



, -!

+2

Source: https://habr.com/ru/post/1677132/


All Articles