在iOS項目中集成了parse推送通知。不工作。iPhone中的解析推送通知
這裏是我的代碼:
#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
這裏是一個similar post沒有幫助的me..tried所有建議的解決方案。什麼是錯誤的......已經上傳的開發在parse.com中推送SSL。幫助我獲得解決方案。
現在來自parse.com的測試推送消息未在設備中傳遞。
沒有問題描述的解決方案。 「不工作」可能意味着任何事情。 – LearnCocos2D
當我從parse.com發送推送消息,然後它不傳遞給任何設備... – iPhoneProcessor