Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android - Push Notifications - JSON Payload Upgrade #1346

Merged
merged 1 commit into from
Mar 12, 2020

Conversation

AndrewEQ
Copy link
Contributor

@AndrewEQ AndrewEQ commented Feb 27, 2020

  • allows for "deeper" JSON payload to be received, instead of just the first level of key/value pairs
push.on("receivedMessage", function(payloadIn, fromNotificationBar) {

	console.log("Recieved Push Notification: " + payloadIn);
	payload.value = JSON.stringify(payloadIn);

	console.log("fromNotificationBar");
	console.log(fromNotificationBar);

	var notificationData = JSON.parse(payloadIn);

	console.log(JSON.stringify(notificationData));
	console.log(notificationData.notification);

	//Now possible
	console.log(notificationData.notification.alert);
	console.log(notificationData.notification.alert.title);
	console.log(notificationData.customPayload.valueText);
	console.log(notificationData.customPayload.value);

});

- allows for "deeper" JSON payload to be received, instead of just the first level of key/value pairs
@AndrewEQ AndrewEQ requested a review from ckarmy February 27, 2020 09:47
Copy link
Contributor

@ckarmy ckarmy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Work as expected

@ckarmy ckarmy merged commit 62e625d into fuse-open:master Mar 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants