AppStore的臭名昭著的“MissingPushNotificationEntitlementITMS-90078”警告
创始人
2024-09-11 11:30:52
0

问题的原因是应用缺少必要的推送通知权限。需要在Xcode中进行设置,以使应用程序正常运行。以下是解决此问题的代码示例。

1.在Xcode中找到您的应用程序的“Capabilities”选项。

2.确保“Push Notifications”开关已启用。

3.接下来,您需要为您的应用程序生成应用程序ID,并为其启用推送通知。

4.在您的AppDelegate类中添加以下代码:

import UserNotifications

@UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate {

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

    UNUserNotificationCenter.current().delegate = self
    UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { (granted, error) in
        if granted {
            DispatchQueue.main.async {
                application.registerForRemoteNotifications()
            }
        }
    }

    return true
}

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
    let token = deviceToken.map { String(format: "%02.2hhx", $0) }.joined()
    print("Device token: \(token)")
}

func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
    print("Failed to register for remote notifications: \(error.localizedDescription)")
}

}

5.在Info.plist文件中添加以下代码:

aps-environment development

aps-environment production

6.清理并重新构建您的应用程序。 您现在应该不再收到关于“Missing Push Notification Entitlement ITMS-90078”的警告。

相关内容

热门资讯

透视挂透视!hhpoker辅助... 透视挂透视!hhpoker辅助器,xpoker辅助工具,必胜教程(一直是真的有挂)科技教程也叫必备教...
透视脚本!aapoker俱乐部... 透视脚本!aapoker俱乐部靠谱吗,hhpoker透视脚本下载,每日必备(有挂攻略)是一款可以让一...
辅助透视!智星德州菠萝安装,h... 辅助透视!智星德州菠萝安装,hhpoker辅助挂下载,AI教程(原来有挂)准备好在智星德州菠萝安装 ...
透视教学!wpk辅助器下载,w... 您好,wpk辅助器下载这款游戏可以开挂的,确实是有挂的,需要了解加微【136704302】很多玩家在...
透视苹果版!wepoker底牌... 透视苹果版!wepoker底牌透视脚本,德普之星透视辅助插件,2025新版教程(固有有挂)关于德普之...
透视存在!wepoker透视脚... 透视存在!wepoker透视脚本安卓,aapoker有脚本吗,必看攻略(有挂透明)1)wepoker...
透视玄学!hhpoker开辅助... 透视玄学!hhpoker开辅助软件,wpk辅助哪里买,wpk教程(切实真的是有挂);亲,其实确实真的...
透视ai!wepoker底牌透... 透视ai!wepoker底牌透视脚本,hhpoker透视脚本视频,每日必备(有挂黑科技)1、任何德州...
透视科技!hhpoker开辅助... 透视科技!hhpoker开辅助软件,aapoker透视脚本,切实教程(一贯真的是有挂);(需添加指定...
透视辅助!wepoker透视脚... 透视辅助!wepoker透视脚本,wepoker辅助器怎么用,教程攻略(有挂规律),您好,wepok...