gpt4 book ai didi

ios - 使用admin.pushapps.mobi的iOS的PhoneGap推送通知

转载 作者:行者123 更新时间:2023-12-01 17:07:01 26 4
gpt4 key购买 nike

如何在iOS平台上接收PhoneGap推送通知?

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

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

谁能解释我错了吗?如果还有其他具有PhoneGap文档的推送通知服务,则将很有帮助。

最佳答案

您应该检查两件事,以使PushApps可以正常工作:

  • 证书和配置文件匹配。
  • 您应该验证Wiki中提到的AppDelegate.m是否包含:
    #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];
    }
  • 关于ios - 使用admin.pushapps.mobi的iOS的PhoneGap推送通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29210918/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com