Разбор push-уведомлений в iphone

Интегрированное разбор push-уведомлений в проекте iOS. Не работает.

Вот мой код:

#ifdef ENABLE_PARSE_PUSH
#import "Parse/Parse.h"
#endif

//in appDelegate didFinishLaunchingWithOptions

#ifdef ENABLE_PARSE_PUSH

    // Obtain the installation object for the current device

    [Parse setApplicationId:PARSE_APP_ID clientKey:PARSE_APP_SIGNATURE];

    PFInstallation *myInstallation = [PFInstallation currentInstallation];

    // Save some data
    [myInstallation setObject:@"YES" forKey:@"scoreUpdates"];

    // Save or Create installation object
    [myInstallation saveInBackground];

    [application registerForRemoteNotificationTypes:
     UIRemoteNotificationTypeBadge |
     UIRemoteNotificationTypeAlert |
     UIRemoteNotificationTypeSound];
#endif



#ifdef ENABLE_PARSE_PUSH
- (void)application:(UIApplication *)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)newDeviceToken
{
    [PFPush storeDeviceToken:newDeviceToken]; // Send parse the device token
    // Subscribe this user to the broadcast channel, ""
    [PFPush subscribeToChannelInBackground:@"" block:^(BOOL succeeded, NSError *error) {
        if (succeeded)
        {
            //#ifdef DEBUG
            //NSLog(@"Successfully subscribed to the broadcast channel.");
            //#endif
        }
        else
        {
            //#ifdef DEBUG
            //NSLog(@"Failed to subscribe to the broadcast channel.");
            //#endif
        }
    }];
}

- (void)application:(UIApplication *)application
didReceiveRemoteNotification:(NSDictionary *)userInfo {
    [PFPush handlePush:userInfo];
}

#endif

вот один подобный пост не помог мне.. перепробовал все предложенные решения. Что не так.. уже загрузил разработку push SSL в parse.com. помогите мне найти решение.

Теперь тестовое push-сообщение с parse.com не доставляется на устройство.

2 ответа

Решение

Хорошо, наконец, решил эту проблему.

• Нам нужно создать новый профиль обеспечения после настройки push SLL в разделе идентификатора приложения. Затем нам нужно использовать новый профиль обеспечения.

Это решило мою проблему и теперь получает тестовое push-сообщение от Parse.

Привет. Попробуйте этот пошаговый учебник Parse https://www.parse.com/tutorials/ios-push-notifications

Следуйте инструкциям, и если вы получите стек, вы можете написать здесь о помощи.

Другие вопросы по тегам