2

如何在ios平台接收PhoneGap推送通知...?

我正在使用http://admin.pushapps.mobi控制台发送通知,我已经为 ios 配置了所有内容,并在我的 javascript 文件中使用了应用程序令牌。我已经从 admin.pushapps.mobi 发送了一条通知,但它没有在我的应用程序中进行审核。

我正在使用他们提供的演示.....下面是完整链接https://github.com/PushAppsService/PhonegapBuildExampleApp

谁能解释我错在哪里?如果有任何其他具有 PhoneGap 文档的推送通知服务,那将会很有帮助。

4

2 回答 2

0

您应该检查 2 件事情以使 PushApps 按预期工作:

  1. 证书和配置文件匹配。
  2. 您应该验证您的 AppDelegate.m 包含 wiki 中提到的内容:

    #import "PushApps.h"
    
    #pragma mark - Push Notifications
    
    #ifdef __IPHONE_8_0
    - (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings
    {
       [[PushAppsManager sharedInstance] didRegisterUserNotificationSettings:notificationSettings];
    }
    
    - (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void(^)())completionHandler
    {
       [[PushAppsManager sharedInstance] handleActionWithIdentifier:identifier forRemoteNotification:userInfo  
    completionHandler:completionHandler];
    }
    #endif
    
    - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
    {
       // Notify PushApps of a successful registration.
       [[PushAppsManager sharedInstance] updatePushToken:deviceToken];
    }
    
    // Gets called when a remote notification is received while app is in the foreground.
    - (void)application:(UIApplication *)application didReceiveRemoteNotification:  (NSDictionary *)userInfo
    {
       [[PushAppsManager sharedInstance] handlePushMessageOnForeground:userInfo];
    }
    
    - (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
    {
       // keeps you up to date with any errors during push setup.
       [[PushAppsManager sharedInstance] updatePushError:error];
    }
    
于 2015-03-23T13:52:06.617 回答
-1

不要使用 pushapps.mobi 给你所有有限的通知和用户计划,当你获得超过一百万用户之后,关闭你的帐户,然后告诉你是否要退还你的帐户越来越多的钱 juswsh 层

于 2015-11-23T07:55:45.847 回答