-
Notifications
You must be signed in to change notification settings - Fork 26
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
iOS deep linking #396
base: master
Are you sure you want to change the base?
iOS deep linking #396
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have we tested this in Waypoint yet?
if (urlString) { | ||
NSURL *url = [NSURL URLWithString:urlString]; | ||
if (url) { | ||
if([[RadarDelegateHolder sharedInstance] didHandleURL:url]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
linting
} | ||
UIApplication *application = [UIApplication sharedApplication]; | ||
if ([application canOpenURL:url]) { | ||
[application openURL:url options:@{} completionHandler:nil]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is deprecated: https://developer.apple.com/documentation/uikit/uiapplication/1622961-openurl
looks like this is how we'd want to do this: https://developer.apple.com/documentation/uikit/uiapplication/1648685-open
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'm using the right objective C version of it: https://developer.apple.com/documentation/uikit/uiapplication/1648685-openurl?language=objc
RadarSDK/RadarNotificationHelper.m
Outdated
|
||
// Call the original method (which is now swizzled) | ||
[self swizzled_userNotificationCenter:center didReceiveNotificationResponse:response withCompletionHandler:completionHandler]; | ||
} | ||
|
||
+ (void)handleURLFromNotification:(UNNotification *)notification { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to openURLFromNotification
This PR adds deep linking support to the SDK.
Dashboard Setup
From the dashboard, an user should configure the geofence metadata to include the key value pair for
radar:notificationURL
SDK setup
Automatic Setup
The user can also perform the following to have setup done automatically
Manual Setup
If the user does not wish to use the automatic setup, the user should implement
Handling URL links in app
RadarURLDelegate
RadarURLDelegate
is a light weight way to handle the URL navigation in app.To handle the deep link URL, one can implement
RadarURLDelegate
to handle the URL that is passed down by the on premise notification.It is optional to implement
RadarURLDelegate
and to set theradarInitializeOptions.urlDelegate
toYES
.Default iOS setup
If the
radarInitializeOptions.urlDelegate
is not defined or returnsfalse
, we will default to calling[application openURL:url options:@{} completionHandler:nil];
If you're not relying on the
RadarURLDelegate
, you should implementor
React native setup
Dogfood/ QA:
Using a custom build of waypoint using this dependency: https://expo.dev/accounts/radarlabs/projects/waypoint/builds/37c534bf-d646-4fbb-b412-17b3cd426cca
We create a on premise notification that deeplinks to the setting page.
This feature is currently only available in the staging env
trimmed.deep.link.screen.capture.mov