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