facebookarchive / FBNotifications

Facebook Analytics In-App Notifications Framework
https://developers.facebook.com/products/push-campaigns
Other
493 stars 82 forks source link

presentPushCardForRemoteNotificationPayload causing exception when sending test In-App notification - campaignIdentifierFromRemoteNotificationPayload coming nil #45

Open Gurpreet0105 opened 6 years ago

Gurpreet0105 commented 6 years ago

I tried sending a in-app push but while testing it for a particular device id it throughs an exception While investigating the issue i found that in the payload dictionary there is no key name campaign ([@"fb_push_payload"][@"campaign"]) in the dictionary.

Response of the userData

{ aps = { alert = { body = Test; title = iOS; }; "content-available" = 1; sound = default; }; "fb_push_card" = { actions = { actions = ( { backgroundColor = "#3A84C5FF"; borderColor = "#ABABABFF"; borderWidth = 0; content = { "_type" = StyledText; align = center; color = "#FFFFFFFF"; size = 15; text = "Button One"; }; }, { backgroundColor = "#89A9C4FF"; borderColor = "#ABABABFF"; borderWidth = 0; content = { "_type" = StyledText; align = center; color = "#FFFFFFFF"; size = 15; text = "Button Two"; }; } ); background = { "_type" = Color; rgbaHex = "#FFFFFFFF"; }; contentInset = 10; cornerRadius = 10; height = 44; layoutStyle = vertical; style = attached; topInset = 10; }; backdropColor = "#333333CC"; body = { background = { "_type" = Color; rgbaHex = "#FFFFFFFF"; }; content = { "_type" = StyledText; align = center; color = "#333333FF"; size = 15; text = "Body text"; }; contentAlign = center; }; contentInset = 20; cornerRadius = 12; dismissColor = "#000000E6"; "fb_dashboard" = { background = { "_type" = Color; rgbaHex = "#FFFFFFFF"; }; "hero_image_handle" = ""; "hero_image_id" = ""; }; hero = { background = { "_type" = Color; rgbaHex = "#768C97FF"; }; contentAlign = center; height = ""; }; size = medium; version = "1.0"; }; }

igy commented 6 years ago

I've just encountered this same issue when attempting to implement the feature.

That this happens specifically when sending a test notification is unfortunate because it took me so long to realise it wasn't a problem with my use of the SDK, but the frontend sending the wrong data

And to clarify, saving the campaign and sending it live works OK, only the test notification is affected.

Gurpreet - did you ever hear anything from Facebook about this? Did you file a bug report on the developer site? edit: i'll file it with them shortly