[英]Stop only firebase push-notification vibration
在目标c中的app处于地面时,如何停止Firebase推送通知振动?
You can try 你可以试试
-(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler{
if([[UIApplication sharedApplication] applicationState] == UIApplicationStateActive ) {
completionHandler(UNAuthorizationOptionAlert | UNAuthorizationOptionBadge);
else {
completionHandler(UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionBadge);
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.