PushWoosh Error : status code : 210 status_message: Invalid device token for Android - google-cloud-messaging

I am trying to register device token on pushwoosh services using API but it's returning me following response (Form Pushwoosh service) :
{ status_code: 210,
status_message: 'Invalid token: apa91bhosngjexchs528yuy-y4woqtkoo5b3ydddkh29etjm6eg9thg5urchcqaae32lavevq5vdco6mbyozyld4mqajg_t8-aaqnxiz6fr1gwnml7maurolpibo7-hj3at5l3i7zvzw',
response: null }
I am using Same API for iOS and it's working fine for iOS.
But the problem is with Android device. Also device token is correct (Started from "AP91...") and App is registered onGCM as well.
Thanks for help.

I got the solution and it's silly mistake I have done.
Just Uploading Answer if someone new learner get stuck, so it will helpful.
While making API call to pushwoosh registration we are sending following request in API.
"request":{
"application":"84170-XXXXX",
"push_token":deviceInfo.deviceToken,
"language":"en",
"hwid": deviceInfo.HardwareID,
"timezone": 3600,
"device_type":deviceType
}
Mistake was I missed hwid which is unique (We are using device Mac address now).
Also for Android "device_type" =3 and for ios "device_type"=1 But I earlier I was sending 1 for both (And thats the issue).
Now I am sending it according to device type. (As per given in pushwoosh docs).
and it's working fine now.
Thanks.

Related

JsonRpc request from ios 12 sends empty content

I am using vue-json-rpc-client-fetch-withcredentials for comunication with my api via jsonRpc in my ionic5/vue project. Comunication works fine in browser and ios 13 (devices and simulators), but when i running app on ios 12, request’s response is "Invalid request". The reason of invalid request is, that reguest’s content is empty. Does anyone know why? I am using Capacitor to create ios version. I tried to create request with another ways, but i have still the same error.
I changed setting for headers on API server and it's working now. So, it's really the difference between
header('Access-Control-Allow-Headers: *');
and
header("Access-Control-Allow-Headers: {$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']}");

React-native android , REST api post error getting "access denied"

Developing sample application, when i was call the post method
service in componentDidMount() getting error response access
denied. Only android it's having this issue. But I got this
response IOS Devices .
I researched this case Most of the this issue get an based up on
NetWork same wife connection like emulator and my System this is
fine.
when i was check on AndroidManifest.xml file also getting
Internet Permissions also Accessed.But Still getting this Error in
Android. Please Solve this ,
Only getting in Android Device and emulator having this issue
other Platform device like IOS working fine.
Thanks in Advance.
If the REST server is on localhost in Android you'll have to use your IP instead of http://localhost.
If the rest server is not on localhost you might have to adjust the body and the headers. So instead of string body use a json object etc.
Your code:
fetch('site:ab4aca652284d7dc87ca1f347f2ac432#ori-eu-west-1.s‌​‌​earchly.co…
',{ method:'POST', headers:{ 'Accept':'application/json',
'Content-Type':'application/json' }, body:JSON.stringify(string)
}).then((response)=>response.json()).then((responseData)=>{
}).catch((err)=>{ console.error(err) })
rowDatanewOrders:{"status":"error","message":"access denied"}
make sure you have a valid json in body if you have the header 'Content-Type':'application/json', not a string as you have now!
more details about possible adjustments of the body and headers here:
https://github.com/facebook/react-native/issues/5222

Safari Push notification is not working

I have been trying Safari push notification. I followed the Apple doc.
Downloaded Apple intermediate Certificate AppleWWDRCA.cer. Exported my website provisioning profile as p12. To create the push Package used ruby package push_package
It created a package zip and it contains all the details that we needed - icon.iconset, manifest.json, signature and website.json.
When I request permission it successfully retrieves all data and gives me token.
But the real problem is when I try to send notification from a PHP script or APN tester its not receiving in the safari. The v1/logs getting called instead with some circular Json object.
Have no idea what to do next. can anyone please help ??
And one more thing I found is, in the logs SafariNotificationAgent (unknown version)
The error was in payload that I used.
It should be like:
{
"aps":{
"alert":{
"title":"Hi there",
"body":"How are you",
"action":"viewed"
},
"url-args":[""]
}
}

Push notification support in Twilio IOS sdk

I'm trying to get push notifications on an app that's using Twilio IP Messaging. After following the instructions on twilio guides.
The AppDelegate functions to register for remote notifications is working well - the iOS devices successfully provides the device token to the Twilio Client. However, the TwilioIPMessagingClient gives no indication of success or failure while registering the token.I have used delegates also for that Moreover, I don't get any sign of push notifications when messages get sent.
I have checked logs also where I can see the correct logs:
TNNotificationClient | Starting registration..., id: <....>
TNRegTransport | Creating registration: apn - <....>
TNRegTransport | Registration is created, location: https://ers.us1.twilio.com/v1/registrations/<...>
Where exactly I'm missing? One hint I got to know after much research that in server PHP app, I need to enable push on IPMesaging services client becuase its disabled by default. If yes, where exactly or in which .php file I have to enable it?
Reference:
https://www.twilio.com/docs/api/ip-messaging/guides/push-notification-configuration
Someone else recently solved this problem realizing that they had not set the New Message notification type to be explicitly enabled as follows from the PHP example:
// Update the service webhooks
$service = $client->services->get("YOUR_IP_MESSAGING_SERVICE_SID");
$response = $service->update(array(
"Notifications.NewMessage.Enabled" => "true",
"Notifications.NewMessage.Template" => "A New message in ${CHANNEL} from ${USER}: ${MESSAGE}",
));
?>
Would this solve it for you?

android simple facebook returns "Canceled by user" when publishing post

I have configured android simple facebook library for my app.
It's working properly, but the problem is when using mSimpleFacebook.publish(feed, true, onPublishListener), it always fails with error "canceled by user".
Permission[] permissions = new Permission[] {
Permission.EMAIL,
Permission.PUBLIC_PROFILE,
Permission.PUBLISH_ACTION
};
Any idea what the problem might be?
Thanks