Comments (9)
- EBForeNotification 会自动添加到 controller 上面展示,App 刚刚启动没有任何 controller,无法展示。建议你不要在 didFinishLaunching 里调用 EBForeNotification,选择合适的时机再调用。
- 如果你没有在 didFinishLaunching 里调用,那么你的闪退可能跟 EBForeNotification 无关。
from ebforenotification.
「在杀死程序的情况下收到远程推送会闪退」,你的意思是不是杀死程序以后收到推送,点击推送横幅启动App,然后会闪退?
from ebforenotification.
就是在杀死情况 收到推送的 点击推送 ,闪一下,就退了
from ebforenotification.
无论是点击的推送列表还是横幅
from ebforenotification.
Tap推送横幅或者列表闪退。
我在这里调用EBForeNotification在iOS 9上也会闪退 - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
iOS 10上像下面这样没问题
#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
-
(void)userNotificationCenter:(UNUserNotificationCenter *)center
willPresentNotification:(UNNotification *)notification
withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler {
// Print message ID.
NSDictionary *userInfo = notification.request.content.userInfo;
NSLog(@"Message ID: %@", userInfo[@"gcm.message_id"]);// Print full message.
NSLog(@"userInfo: %@", userInfo);[EBForeNotification handleRemoteNotification:userInfo soundID:1312 isIos10:YES];
}// Receive data message on iOS 10 devices.
-
(void)applicationReceivedRemoteMessage:(FIRMessagingRemoteMessage *)remoteMessage {
// Print full message
NSLog(@"remoteMessage %@", [remoteMessage appData]);
}
#endif
from ebforenotification.
在iOS 9上这么用就不会闪退了,判断下是否UIApplicationStateActive
-
(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
if(NULL != userInfo && userInfo.count > 0) {
// Print message ID.
NSLog(@"Message ID: %@", userInfo[@"gcm.message_id"]);// Pring full message. NSLog(@"userInfo %@", userInfo); UIApplicationState state = [[UIApplication sharedApplication] applicationState]; if (state == UIApplicationStateActive) { [EBForeNotification handleRemoteNotification:userInfo soundID:1312]; }
}
completionHandler(UIBackgroundFetchResultNewData);
}
from ebforenotification.
thx,我稍后自己考虑一下这块,把这些判断加到 EBForeNotification 里面。
from ebforenotification.
楼上正确,现在不闪退了,,,tks
from ebforenotification.
@LGLee @lai3d
你好,这个仓库已经不再维护,你可以使用新的仓库 EBBannerView。它对此进行了重构,并且提供更多你想不到的强大功能,欢迎使用 :)
from ebforenotification.
Related Issues (20)
- 加pod支持吧 HOT 3
- Wrong fonts for iOS 10 HOT 10
- Wrong appName parameter HOT 5
- 如果加title和subtitle就会崩溃 HOT 5
- 建议优先采用CFBundleDisplayName HOT 2
- 动画导致Alert显示到了左上角 HOT 3
- 监听点击弹窗的事件、用户点击以后可以取到推送内容为空 HOT 5
- 这个开源项目是个静态库? HOT 4
- 请问支持bitCode吗 HOT 1
- 可否使用系统默认提示音 HOT 7
- 问一下 展示时间默认多少,可以配置吗? HOT 4
- 横屏通知显示仍是竖屏样式 HOT 1
- Crash when receiving notification of type: {title: <title>, body: <body} HOT 1
- Crash inside [EBBannerView removeWithAnimation] HOT 1
- Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle HOT 7
- 静音下声音没有设置么 HOT 7
- 获取 App Name这块 作了修改 HOT 5
- Notification time is a constant HOT 4
- Alert View Position is top when push notification is handled. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ebforenotification.