Skip to content
This repository was archived by the owner on Sep 4, 2020. It is now read-only.
This repository was archived by the owner on Sep 4, 2020. It is now read-only.

Not every key in the firebase's {android/ios}.notification object is supported in "additionalData" object #2932

@stagefright5

Description

@stagefright5

Expected Behaviour

Should preserve all the "unsupported" keys in the "additionalData" object

Actual Behaviour

Does not preserve all the key-value pairs in Androidref and iOSref notification objects

For example: image, sticky, visibility, notification_count

Reproduce Scenario (including but not limited to)

Send a notification through FCM to an app that is using this plugin and log the argument of .on('notification')'s callback

Steps to Reproduce

  1. Initialize the android and iOS notifications
  2. Listen for "notification" event
  3. Log the argument of the event listener's callback

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

Android 9

(Android) What device vendor (e.g. Samsung, HTC, Sony...)

Samsung

Cordova CLI version and cordova platform version

cordova --version   # 9.0.0
cordova platform version android     # 7.14.0

Plugin version

cordova plugin version | grep phonegap-plugin-push  # 2.2.3

Sample Push Data Payload

{
    title: title,
    body: body,
    icon: icon,
    color: pinkColor,
    // "sound": string,
    tag: randomtag,
    // "click_action": string,
    // "body_loc_key": string,
    // "body_loc_args": [
    //   string
    // ],
    // "title_loc_key": string,
    // "title_loc_args": [
    //   string
    // ],
    // "channel_id": string,
    // "ticker": string,
    sticky: sticky,
    // "event_time": string,
    // "local_only": boolean,
    // "notification_priority": ,
    // "default_sound": boolean,
    default_vibrate_timings: default_vibrate_timings,
    // "default_light_settings": boolean,
    // "vibrate_timings": [
    //   string
    // ],
    visibility: visibility,
    notification_count: count,
    // "light_settings": {
    //   object(LightSettings)
    // },
    image: image
}

Sample Code that illustrates the problem

// After registration
push.on("notification", (function(data) {
                        console.log('[_initializeAndroidIOSNotifications] on push "notification":', data.additionalData);
});

Logs taken while reproducing problem

--

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions