Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thegamenicorus/react-native-bypass-deeplink-with-notification
https://github.com/thegamenicorus/react-native-bypass-deeplink-with-notification
Last synced: 11 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/thegamenicorus/react-native-bypass-deeplink-with-notification
- Owner: thegamenicorus
- Created: 2018-04-16T01:49:52.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-04-16T02:25:19.000Z (over 6 years ago)
- Last Synced: 2024-11-08T04:41:26.742Z (2 months ago)
- Language: Objective-C
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-native-bypass-deeplink-with-notification (iOS)
**note: this repository is just a quick fix, not an elegant solution at all.### Problem:
When press on notification bar (contain deep link url) and the iOS app is in closed state(terminated). Then `Linking.getInitialURL()` cannot receive notification url (url always null) in react-native side.### Cause:
in RCTLinkingManager.m , `getInitialURL` is waiting for some data in `bridge.launchOptions` property [#issue-5047(322290739)](https://github.com/facebook/react-native/issues/5047#issuecomment-322290739)### Quick fix:
in RCTLinkingManager.m at `RCT_EXPORT_METHOD(getInitialURL)`, set `NSURL *initialURL = url;`while url is from AppDelegate.m ::
`- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary *)options {
return [RCTLinkingManager application:application openURL:url options:options];
}`### Manual:
1. clone this repository and move `lib` to your react-native project root
2. Xcode -> your project settings -> Build Phases -> Add( + button ) -> New Run Script Phase
3. put shell command `cp ../lib/LinkingIOS/RCTLinkingManager.m ../node_modules/react-native/Libraries/LinkingIOS/RCTLinkingManager.m`
4. Projduct -> Build (`/node_modules/react-native/Libraries/LinkingIOS/RCTLinkingManager.m` should be replaced with `/lib/LinkingIOS/RCTLinkingManager.m`)
5. Run project.