Giter Site home page Giter Site logo

hello ,iOS环境下,EBForeNotification和极光推送混用的时候,在杀死程序的情况下收到远程推送会闪退 about ebforenotification HOT 9 CLOSED

pikacode avatar pikacode commented on July 30, 2024 1
hello ,iOS环境下,EBForeNotification和极光推送混用的时候,在杀死程序的情况下收到远程推送会闪退

from ebforenotification.

Comments (9)

pikacode avatar pikacode commented on July 30, 2024 2
  • EBForeNotification 会自动添加到 controller 上面展示,App 刚刚启动没有任何 controller,无法展示。建议你不要在 didFinishLaunching 里调用 EBForeNotification,选择合适的时机再调用。
  • 如果你没有在 didFinishLaunching 里调用,那么你的闪退可能跟 EBForeNotification 无关。

from ebforenotification.

pikacode avatar pikacode commented on July 30, 2024

「在杀死程序的情况下收到远程推送会闪退」,你的意思是不是杀死程序以后收到推送,点击推送横幅启动App,然后会闪退?

from ebforenotification.

LGLee avatar LGLee commented on July 30, 2024

就是在杀死情况 收到推送的 点击推送 ,闪一下,就退了

from ebforenotification.

LGLee avatar LGLee commented on July 30, 2024

无论是点击的推送列表还是横幅

from ebforenotification.

lai3d avatar lai3d commented on July 30, 2024

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.

lai3d avatar lai3d commented on July 30, 2024

在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.

pikacode avatar pikacode commented on July 30, 2024

thx,我稍后自己考虑一下这块,把这些判断加到 EBForeNotification 里面。

from ebforenotification.

LGLee avatar LGLee commented on July 30, 2024

楼上正确,现在不闪退了,,,tks

from ebforenotification.

pikacode avatar pikacode commented on July 30, 2024

@LGLee @lai3d
你好,这个仓库已经不再维护,你可以使用新的仓库 EBBannerView。它对此进行了重构,并且提供更多你想不到的强大功能,欢迎使用 :)

from ebforenotification.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.