如何处理ios中的城市飞艇深层链接,如何在通知中接收配置的深层链接,我可以通过城市飞艇发送深层链接,一旦通知收到我应该使用哪种方法来处理深层链接。
答案 0 :(得分:0)
你有两个解决方案。
在您的应用中添加custom url scheme。然后使Urban Airship推送消息中的所有深层链接都包含此自定义URL方案。
Urban Airship会自动在此深层链接上调用打开的应用程序,从而在您的应用程序上设置深层链接。
将您的课程添加为UAPush
单身人士的推送通知代理。
- (void)initializePushMessageService {
[UAirship takeOff];
[UAPush shared].pushNotificationDelegate = self;
}
#pragma mark - UAPushNotificationDelegate
- (void)launchedFromNotification:(NSDictionary *)notification
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
if([self hasDeeplink:notification]) {
NSString *deeplink = [self deepLinkPathFromNotification:notification];
//do something with the deeplink
}
}
#define kUrbanAirshipDeepLinkKey @"^d"
- (BOOL)hasDeeplink:(NSDictionary *)notification {
return notification[kUrbanAirshipDeepLinkKey] != nil;
}
- (NSString *)deepLinkPathFromNotification:(NSDictionary *)notification {
return notification[kUrbanAirshipDeepLinkKey];
}