admin管理员组文章数量:1416626
I have a tvOS Obj-C app that I'm having issues with sending a silent notification. I use Parse on back4app and am using CloudCode so when I save a class, it sends a silent notification the Apple TV and makes some changes there.
In my AppDelegate.m I have:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[Parse initializeWithConfiguration:[ParseClientConfiguration configurationWithBlock:^(id<ParseMutableClientConfiguration> configuration) {
configuration.applicationId = @"APPID";
configuration.clientKey = @"CLIENTKEY";
configuration.server = @";;
}]];
self.window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds];
// Load the Main storyboard
UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
// Instantiate the initial view controller from the storyboard
UITabBarController *tabBarController = [mainStoryboard instantiateInitialViewController];
// Set the tab bar controller as the root view controller
self.window.rootViewController = tabBarController;
// Make the window key and visible
[self.window makeKeyAndVisible];
[application registerForRemoteNotifications];
return YES;
}
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
if ([userInfo[@"action"] isEqualToString:@"update_songs_list"]) {
NSLog(@"Received push notification: Updating song list.");
// Post a notification so the relevant view controller can handle it
[[NSNotificationCenter defaultCenter] postNotificationName:@"UpdateSongsListNotification" object:nil];
}
}
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
if ([userInfo[@"action"] isEqualToString:@"update_songs_list"]) {
NSLog(@"
本文标签:
parse platformSending Push to tvOSStack Overflow
版权声明:本文标题:parse platform - Sending Push to tvOS - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人,
转载请联系作者并注明出处:http://www.betaflare.com/web/1745256311a2650122.html,
本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论