- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
<分区>
直到今天早上一切正常,我需要设备 token 才能继续当我在 iOS 设备上调试时,didRegisterForRemoteNotificationsWithDeviceToken 和 didFailToRegisterForRemoteNotificationsWithError 方法都不会被触发。我真的很感激一些帮助。我的代码如下。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0){
UIUserNotificationType types = UIUserNotificationTypeBadge |
UIUserNotificationTypeSound | UIUserNotificationTypeAlert;
UIUserNotificationSettings *mySettings =
[UIUserNotificationSettings settingsForTypes:types categories:nil];
[application registerUserNotificationSettings:mySettings];
//[application registerForRemoteNotifications];
}else{
[application registerForRemoteNotificationTypes:
(UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];
}
return YES;
}
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
NSLog(@"didRegisterForRemoteNotificationsWithDeviceToken: %@", deviceToken);
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
NSString *deviceID = [[deviceToken description] stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"<>"]];
deviceID = [deviceID stringByReplacingOccurrencesOfString:@" " withString:@""];
NSLog(@"Device_Token -----> %@\n",deviceID);
[[NSUserDefaults standardUserDefaults] setObject:deviceID forKey:@"KiviDeviceToken"];
[[NSUserDefaults standardUserDefaults] synchronize];
}
-(void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
{
NSLog(@"Error: %@", error.description);
if (error.code == 3010) {
NSLog(@"Push notifications are not supported in the iOS Simulator.");
} else {
NSLog(@"application:didFailToRegisterForRemoteNotificationsWithError: %@", error);
}
}
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings
{
NSLog(@"NotificationSettings: %@", notificationSettings);
//register to receive notifications
[application registerForRemoteNotifications];
}
我检查过iOS 设置应用程序通知已启用,不会调用该方法
我需要一些关于“排除推送通知故障”的帮助“如果既没有委托(delegate)回调应用程序:didRegisterForRemoteNotificationsWithDeviceToken:也没有应用程序:didFailToRegisterForRemoteNotificationsWithError:被调用,NotificationSettings 正在获取我认为回调不是调用,因为连接尚未建立。”
我目前正在使用 Xcode6 beta(第一个版本)。使用 parse.com,我正在尝试实现推送通知。在我的应用委托(delegate)中,我有 [application registerFor
当我在我的应用委托(delegate)上注册远程通知时: [[UIApplication sharedApplication] registerForRemoteNotificationTypes:
我见过很多不同的通知权限请求实现,但我仍然不知道哪一个是最好的。这可能是重复的,但我想要一个包含最新 Apple 推荐的 2015 答案。 我的一般问题是,是将 registerForRemoteNo
Xcode 9 (iOS 11) 在注册推送(远程)通知时向我显示错误/警告。 这里是错误信息 这是我试过的代码: let center = UNUserNotificationCenter.cur
我正在开发一个涉及远程通知的 macOS 应用程序。在我的应用委托(delegate) appDidFinishLaunching 中,我只需调用 NSApplication.shared.regis
有人问过这个问题(例如 here 和 here ),但似乎没有一个解决方案适用于我的设置。 我正在 iOS 9/Xcode7 (beta 5) 中开发一个应用程序。 我已经创建了一个明确的 App I
正如苹果关于推送通知的官方信息页面所述: “设备 token 可能会发生变化,因此您的应用每次启动时都需要重新注册。” 我试图理解他们所说的“每次启动”是什么意思。 这是否意味着我必须在 AppDel
这个问题在这里已经有了答案: didRegisterForRemoteNotificationsWithDeviceToken not called in ios8, but didRegister
我的应用有一个 MainViewController、一个 PlaylistViewController 和一个 PlayerViewController。 当您返回主屏幕时,一切正常,在后台播放音频
[[UIApplication sharedApplication] registerForRemoteNotifications]; 调用后不工作 [[UIApplication sharedApp
* 请注意,这个问题不是如何在 swift 中注册远程通知,我的问题是如何在 swift 中编写代码,以便在同时运行 iOS8 和 iOS7 的设备上运行。我发布的代码曾经使用 Xcode beta
I am using @react-native-firebase/app": "^8.2.0", @react-native-firebase/messaging and react-native
我是一名优秀的程序员,十分优秀!