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

Notification icon on iOS shows phonegap default icon instead of the app icon #1218

Closed
yoav-zibin opened this issue Sep 13, 2016 · 10 comments
Closed
Labels

Comments

@yoav-zibin
Copy link

Expected Behaviour

Show the app icon when a push notification arrives.

Actual Behaviour

Phonegap icon is displayed (no idea where it even came from), see printscreen:
5a1479a2-3cd4-43d1-bfd6-6041b37c8f3b

Reproduce Scenario (including but not limited to)

I use phonegap build with this repo:
https://github.com/yoav-zibin/friendlygo-phonegap/tree/master/www
Note that my icon have .pgbomit to save space.

Maybe that's causing the issue?

Will passing icon in the payload (as described for android) work on iOS?

Steps to Reproduce

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

iOS 10 :)

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

Works fine on Android.

Cordova CLI version and cordova platform version

cli-6.3.0

cordova --version                                    # e.g. 6.0.0
cordova platform version android                     # e.g. 4.1.1

Plugin version

1.8.1
gap:plugin name="phonegap-plugin-push" source="npm" spec="1.8.1"

Sample Push Data Payload

{"message":"Your turn\nGuest-872 just played","count":3,"additionalData":{"matchId":"3297837026043734190","updatedTimestampMillis":"1473799221807","foreground":true,"coldstart":false,"notId":"2029297307","matchInfoJson":"..."}}

Sample Code that illustrates the problem

Logs taken while reproducing problem

@yoav-zibin
Copy link
Author

BTW, you can reproduce the issue with the live app here:
https://itunes.apple.com/us/app/ycheckers/id1105953393?mt=8

I really have no clue where it took the default phonegap icon from :)

@macdonst macdonst added the pgb label Sep 13, 2016
@macdonst
Copy link
Member

the PGB team has asked for people with issues regarding phonegap build please start an issue on the support forum: https://forums.adobe.com/community/phonegap/build

please include an app id of an app that can replicate this issue.

@fredgalvao
Copy link
Collaborator

By looking at your config.xml, which by the way is placed in the wrong spot (it should be in the project root, instead of inside the www folder), I see you're pointing here for your content. Digging deeper, on this js file, I can see that this is your registration code (unminified and beautified):

var a = p.PushNotification.init({
    android: {
        senderID: "24803504516",
        clearNotifications: !1
    },
    ios: {
        alert: !0,
        badge: !0,
        sound: !0,
        clearBadge: !0
    },
    windows: {}
});

And the lack of android.icon there says that "I don't want to specify any icon for my notifications", according to the usage described here in the docs.

Conclusion

You should try actually specifying the icon property and see if it obeys you as one would expect.

What should be the behaviour if you don't specify it? Should it be blank? No icon at all? Search for a default one (it's probably doing this option right now, it seems)? I honestly don't know.

@yoav-zibin
Copy link
Author

I really appreciate the quick replies :)

It's actually working fine on android (even without android.icon).
The problem is on ios :)
I unzipped the IPA and I think I figured out the issue and it's indeed a phonegap build issue: I didn't specify a "3x" icon so they used the default icon for AppIcon29x29@3x.png .

BTW, last question:
will passing "image" on the payload work on ios?
For example, the docs say this works on android, but they don't mention ios:
"title": "Large Icon",
"message": "Loaded from URL",
"image": "https://dl.dropboxusercontent.com/u/887989/antshot.png"

It would be awesome if it worked for ios too :D

See working example on android:
screenshot_20160913-175832

@macdonst
Copy link
Member

@yoav-zibin no, it won't work on iOS as that OS doesn't allow you to change the push notification icon. It only uses your app icon.

@stileinverso
Copy link

stileinverso commented Oct 10, 2016

Same problem here!
In iOS the push notification icon is the PGB default icon, not the app icon (in Android I can see the app icon instead).
How can I fix it in iOS?
Is there a link to show me how I can use the app icon with push notification?

Should I use one or more lines of code in the app in particular?
Should I upload an icon of the app in a particular location?
Should the icon have special characteristics?
Does it depend on PHP code that sends the push notification?

img_0003

@tejit2004
Copy link

Same issue here, any solution?

@lpender
Copy link

lpender commented Aug 11, 2017

PhoneGap may need to add support for notification icon sizes:

https://developer.apple.com/ios/human-interface-guidelines/graphics/app-icon/

image

I'm passing the icon sizes but seeing this:

image

@lucasalima
Copy link

Anyone found a solution for this issue? I'm facing the same situation of you guys. PLEASE HELP!

@lock
Copy link

lock bot commented Jun 3, 2018

This thread has been automatically locked.

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

No branches or pull requests

7 participants