gpt4 book ai didi

UrbanAirship 的 iOS 推送通知错误

转载 作者:行者123 更新时间:2023-11-29 13:36:43 25 4
gpt4 key购买 nike

我终于收到了来自 UrbanAirship 的推送通知。但是现在我有一个问题,在这里搜索并找不到解决方案。

当应用程序正在运行并且我收到通知时,单击通知会将我带入应用程序,一切正常。

当我终止应用程序并收到通知时,应用程序终止并发出 SIGKILL。

这是日志:log

好的,这是我的 appdelegate.m:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//Init Airship launch options
NSLog(@"Before NSMutableDictionary");
NSMutableDictionary *takeOffOptions = [[NSMutableDictionary alloc] init];
[takeOffOptions setValue:launchOptions forKey:UAirshipTakeOffOptionsLaunchOptionsKey];

// Create Airship singleton that's used to talk to Urban Airship servers.
// Please populate AirshipConfig.plist with your info from http://go.urbanairship.com
NSLog(@"Before takeOff");
[UAirship takeOff:takeOffOptions];


// Register for notifications
NSLog(@"Before UIApplication");
[[UIApplication sharedApplication]
registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge |
UIRemoteNotificationTypeSound |
UIRemoteNotificationTypeAlert)];

NSLog(@"Before reset badge");
//reset badge
application.applicationIconBadgeNumber = 0;

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.

self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
self.window.rootViewController = self.viewController;

[self.window makeKeyAndVisible];



return YES;
}

-(void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
NSLog(@"didRegisterForRemoteNotifications");
[[UAirship shared] registerDeviceToken:deviceToken];
}

-(void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
{
NSString *str = [NSString stringWithFormat: @"Error: %@", error];
NSLog(@"Error:%@",str);
}

在此 Mac Mini 通过窗口之前非常感谢任何帮助:-)

最佳答案

我认为这与 Urban Airship 无关。如果你:

  1. 创建一个全新的项目
  2. 插入你的设备
  3. 运行应用
  4. 强制关闭手机上的应用程序(您可能需要尝试重新打开它)

您将收到相同的错误消息。

由于它发生在一个全新的项目中,甚至没有接触它,我认为这种行为是意料之中的。

关于UrbanAirship 的 iOS 推送通知错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10403978/

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