Salve, sto provando a inviare delle notifiche push verso Android/iOS, un po' prendendo spunto dalla demo plug-in, un po' ricordando quanto fatto in Foundation ho scritto un po' di codice:
Sulla app mobile installata su InstaLauncher (non nello store):
yield app.device.notification.hasPermission() ritorna True
var registerOptions = {resubscribe : true} ;
$token.innerText = yield app.device.notification.register(null, registerOptions);
ritorna il token nella forma: gcm-eS9Bjw4A-KQ:APA91...H8VuvuyJ2
Sulla app server:
yield app.device.notification.hasPermission() ritorna True
var notificationObj = {title : "Instant push notification", body : "Hello from Instant Developer Cloud", payload : "XXX123", badge : 1} ;
var res = yield app.device.notification.push(notificationObj, token);
console.log(res);
console.log(res.results[0]);
ritorna:
> {multicast_id: 5615843859414692000, success: 1, failure: 0, canonical_ids: 0, results: Array[1]}
> {message_id: "0:1551945637569072%a799c730f9fd7ecd"}
Sul dispositivo Android non arriva nulla.
Dove sbaglio? Cosa manca? Che differenze ci sono per iOS?