Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LinkingIOS.addEventListener("url", callback) not getting passed url #861

Closed
stuartlynn opened this issue Apr 15, 2015 · 3 comments
Closed
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@stuartlynn
Copy link

I am trying to implement callbacks for URL triggering of the app while its running as described here (https://facebook.github.io/react-native/docs/linkingios.html#content). I have added

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString    *)sourceApplication annotation:(id)annotation {
    return [RCTLinkingManager application:application openURL:url sourceApplication:sourceApplication annotation:annotation];
}

to AppDelegate.m and have included

componentDidMount:function() {
    LinkingIOS.addEventListener('url', this._handleLoginCallback);
},
componentWillUnmount: function() {
  LinkingIOS.removeEventListener('url', this._handleLoginCallback);
},
_handleLoginCallback: function(event) {
   console.log(event)
},

To one of my react components. When the URL is opened in the app the handleLoginCallback function is triggered as expected but event is an empty hash.

When I set breakpoints in the objective-c code I can see the url being passed correctly all the way through to RTCEventDispatcher#sendDeviceEventWithName but it doesn't seem to be making it through the bridge to the javascript code.

This is using react-native version 0.3.11

@christopherdro
Copy link
Contributor

@stuartlynn Are you still having this issue?

@stuartlynn
Copy link
Author

It seems to be working now. Will close the issue. Thanks for checking in

@christopherdro
Copy link
Contributor

👍

@facebook facebook locked as resolved and limited conversation to collaborators May 29, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants