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

Android Marshmallow 6.0 push icon #422

Closed
adyz opened this issue Dec 14, 2015 · 9 comments
Closed

Android Marshmallow 6.0 push icon #422

adyz opened this issue Dec 14, 2015 · 9 comments

Comments

@adyz
Copy link

adyz commented Dec 14, 2015

I have an issue regarding the icon for push notifications in Android Marshmallow 6.0

On all other devices tested, the icon looks as wanted, but on Marshmallow the icon is just an white box.

I have the icon set generated with ionic iconic resources

My init looks like this:

vv.push = PushNotification.init({

    "android": {
        "senderID": vv.params.googleGCMProjectNumber,
        "title":"Vivre",
        "icon": "icon"
    },
    "ios": {
        "alert": "true",
        "badge": "true",
        "sound": "true",
        "clearBadge": true
    }
});

Do I need to change something in my config.xml or in the init or in the json set with the push service?

@fredgalvao
Copy link
Collaborator

What targetSdkVersion are you using (you can check platforms/android/AndroidManifest.xml)? Also, can you confirm that your icon works "as expected" on Android L(5.x)?

@adyz
Copy link
Author

adyz commented Dec 14, 2015

I have <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="22" /> in AndroidManifest.xml

With this setup and config, on my real device, Samsung Galaxy S4, it works as expected.
Version 5.0.1

@adyz
Copy link
Author

adyz commented Dec 14, 2015

Here it is how the icons look: http://imgur.com/a/dBk7g

This is from the emulator taken, but it's the same on the real device but I don't have access to that all the time

@adyz
Copy link
Author

adyz commented Dec 14, 2015

Also, in console, when I push I get: Number format exception - Error parsing notId: Invalid int: "null" are the two correlated? I've searched about this error and it looks like this does not interfere with the notification system.

@nicoabie
Copy link

Does the icon appears in platforms/android/resources folder?

@adyz
Copy link
Author

adyz commented Dec 14, 2015

Yes, the res folder.

But I think the problem is that my icon is not transparent. I think I need to create the small one transparent and the large one from the external source. No sure how I'll handle this because my icon is not transparent.

Damn material design. Any tips on this? Should I micro manage all icons?

screen shot 2015-12-14 at 1 43 28 pm

@adyz adyz closed this as completed Dec 14, 2015
@adyz
Copy link
Author

adyz commented Dec 14, 2015

Guys, since this is changed in android 6.0, wont be great to have a config where to specify the path to the small icon that is changed and leave the rest as it was?

@adyz adyz reopened this Dec 14, 2015
@macdonst
Copy link
Member

@adyz all of this is documented at:

https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/PAYLOAD.md#images

I consider this issue to be closed. You use the icon parameter in the init method to specify the image with transparency you want to see in the push notification and the status bar. If you don't specify anything it will default to the apps main icon.

There is no sense fighting the Material guidelines as this has been a fact of life since Android 5.0. You'll have to work on an icon that has some transparency. Use the transparent pixels like the M in a Gmail icon to provide differentiation.

@lock
Copy link

lock bot commented Jun 5, 2018

This thread has been automatically locked.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

4 participants