Skip to content

plugin doesn't let cordova-plugin-fcm-with-dependecy-updated ^2.4.0 plugin handle notification #627

@dzziwny

Description

@dzziwny

Your Environment

  • Plugin version: 3.0.3
  • Platform: iOS
  • OS version: 11.0.3 and 12.3.1
  • Device manufacturer and model: iPhone 6, iPhone 6s
  • Running in Simulator: no
  • Cordova version (cordova -v): 8.1.2
  • Cordova platform version (cordova platform ls): ios 4.5.4
  • Plugin configuration options:
geolocation.configure({
            locationProvider: _geolocation.ACTIVITY_PROVIDER,
            desiredAccuracy: _geolocation.MEDIUM_ACCURACY,
            stationaryRadius: 0,
            distanceFilter: 0,
            debug: false,
            stopOnTerminate: true,
            stopOnStillActivity: false,
            startForeground: true,
            fastestInterval: 10000,
            interval: 10000,
            maxLocations: 1
        }
  • Link to your project:

Context

in CDVBackgroundGeolocation.m file debugger never goes into if statement

- (void)userNotificationCenter:(UNUserNotificationCenter *)center
       willPresentNotification:(UNNotification *)notification
         withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler
{
    if (prevNotificationDelegate && [prevNotificationDelegate respondsToSelector:@selector(userNotificationCenter:willPresentNotification:withCompletionHandler:)])
    {
        // Give other delegates (like FCM) the chance to process this notification

        [prevNotificationDelegate userNotificationCenter:center willPresentNotification:notification withCompletionHandler:^(UNNotificationPresentationOptions options) {
            completionHandler(UNNotificationPresentationOptionAlert);
        }];
    }
    else
    {
        completionHandler(UNNotificationPresentationOptionAlert);
    }
}

Expected Behavior

plugin should let others handle push data (in my case fcm, which works properly without this plugin)

Actual Behavior

debugger always choses else statement and only displays notification in upper banner, no matter if app is foreground

Steps to Reproduce

  1. clear project
  2. cordova plugin add cordova-plugin-fcm-with-dependecy-updated@^2.4.0
  3. cordova plugin add @mauron85/[email protected]
  4. put breakpoint on line 484 in CDVBackgroundGeolocation.m
  5. send any test push from firebase console

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleauto labeled abandoned issues after a period of inactivity

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions