notification screenshot on IOS Hi I have been trying to send push-notification from android to ios with custom parameters required for my app. Tried sending it as hashmap as in the code above but did not receive that notification at all instead received default notification as :"you have 1 unread message".Also tried sending it as json(Please refer code ) but it goes as plain text and is displayed as json text in the notification to user as shown in the screen shot attached. Please help me with this so i can send notification with only "message" part displayed to user and other custom parameters to be used internally by app.
StringifyArrayList<Integer> userIds = new StringifyArrayList<Integer>();
userIds.add(userId1);
QBEvent event = new QBEvent();
event.setUserIds(userIds);
event.setEnvironment(QBEnvironment.DEVELOPMENT);
event.setNotificationType(QBNotificationType.PUSH);
event.setPushType(QBPushType.APNS);
JSONObject json = new JSONObject();
JSONObject json1 = new JSONObject();
try {
// standart parameters
json.put("text", message);
// custom parameters
json1.put("sellerName", sellerName);
json1.put("Buyer Name", buyerName);
json1.put("Type",type);
json.put("custom",json1 );
} catch (Exception e) {
e.printStackTrace();
}
//HashMap<String, Object> data = new HashMap<String, Object>();
//data.put("message", message);
// data.put("sellerName",sellerName);
//data.put("Type", type);
//event.setMessage(data);
event.setMessage(json.toString());
QBPushNotifications.createEvent(event).performAsync(new QBEntityCallback<QBEvent>() {
@Override
public void onSuccess(QBEvent qbEvent, Bundle bundle) {
System.out.println("QBPush Message success"+qbEvent.getMessage());
}
@Override
public void onError(QBResponseException e) {
// System.out.println(" QB Error in Push Message success");
e.printStackTrace();
}
});