I am developing an iOS app using IBM MobileFirst Platform 8.0 that have push notification capabilities
I have manage to send notification via postman, the process was
- Obtaining a token from mobile first platform server
- Send to notification via rest api along with the token
The tutorial link i have follow is,
Server Side - https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/notifications/sending-notifications/
Client Side - https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/notifications/handling-push-notifications/cordova/
For now, i am trying to send a push notification when the app triggers an adapter call
I am currently stuck on getting the token part using WL.Server.invokeHttp, below is more adapter code and connectivity setting
function getToken() {
var input = {
method : 'post',
returnedContentType : 'application/json',
path : '/mfp/api/az/v1/token',
headers : {
Authorization:"Basic UHVzaE5asdasdas4444rrraWNhdGlvbjpQdXNoasdasd0aW9u",
contentType:'application/x-www-form-urlencoded'
},
body:{
grant_type : "client_credentials",
scope : "push.application.my.app messages.write",
}
};
var results = MFP.Server.invokeHttp(input);
return results;
}
<connectivity>
<connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
<protocol>http</protocol>
<domain>127.0.0.1</domain>
<port>9080</port>
<connectionTimeoutInMilliseconds>60000</connectionTimeoutInMilliseconds>
<socketTimeoutInMilliseconds>60000</socketTimeoutInMilliseconds>
<maxConcurrentConnectionsPerNode>50</maxConcurrentConnectionsPerNode>
</connectionPolicy>
</connectivity>
Do hope for advice, thanks in advance.