Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working only for 1st message. #1

Closed
koolkarni opened this issue May 30, 2016 · 8 comments
Closed

Working only for 1st message. #1

koolkarni opened this issue May 30, 2016 · 8 comments

Comments

@koolkarni
Copy link

I have added following code in my main file:

  • (void)applicationDidEnterBackground:(UIApplication *)application {
    // [[FIRMessaging messaging] disconnect];
    NSLog(@"Disconnected from FCM");
    }

//add this

  • (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)notification {
    [[NSNotificationCenter defaultCenter] postNotificationName: FCMNotificationReceived
    object:self
    userInfo:notification];

}

//add this

  • (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)notification fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))handler {
    [[NSNotificationCenter defaultCenter] postNotificationName:FCMNotificationReceived
    object:self
    userInfo:notification];
    handler(UIBackgroundFetchResultNoData);
    }

the notification is shown only once when app runs for 1st time after installation

@evollu
Copy link
Owner

evollu commented May 30, 2016

Can you provide more details about your issue? eg. your notification payload.
Did you add [FIRApp configure] in appDelegate.m?

@koolkarni
Copy link
Author

Yes, I have added the same

@import Firebase;

@implementation AppDelegate

  • (BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
    *
    [FIRApp configure];**
    [[FBSDKApplicationDelegate sharedInstance] application:application
    didFinishLaunchingWithOptions:launchOptions];

    NSURL *jsCodeLocation;

@evollu
Copy link
Owner

evollu commented Jun 1, 2016

I can't reproduce it in my application. Are you using data payload or notification payload? Is the application in foreground?

@evollu
Copy link
Owner

evollu commented Jun 7, 2016

@koolkarni haven't got updates from you for a while. Have you figured out the issue?

@koolkarni
Copy link
Author

@evollu Sorry for late reply ,I get the notification on emulator but when i run on real mobile it dosent show anything

@koolkarni
Copy link
Author

anyways thanks for help.I will solve the issue and write the details here :)

@evollu
Copy link
Owner

evollu commented Jun 7, 2016

hmm interesting. I thought ios emulators can't get notification. I do get notifications on iphones though

@evollu
Copy link
Owner

evollu commented Jun 16, 2016

closing due to no response

@evollu evollu closed this as completed Jun 16, 2016
renzosal added a commit that referenced this issue Sep 12, 2016
evollu pushed a commit that referenced this issue Dec 1, 2016
* feature(android): add support for badge count (#1)

Using Leolin's ShortcutBadger we are able to support any badge counts that are sent as part of the notifications data-payload.

* refactor(android): expand badge support (#3)
evollu pushed a commit that referenced this issue Mar 6, 2018
evollu pushed a commit that referenced this issue Mar 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants