- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hiii,
I am creating an sample app for push notification in intel XDK. I am using Intel XDK 2807 with CLI 5.1.1 . I have used push notification as third party plugin and used as imported from Git Repo where I included the following details :
Repo URL : https://github.com/phonegap/phonegap-plugin-push
Git Ref : 1.4.3
The plugin was added successfully.....
The following is the index.html contain :
<!DOCTYPE html>
<html>
<head>
<title>Push Notification Sample</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<style>
@-ms-viewport { width: 100vw ; zoom: 100% ; } @viewport { width: 100vw ; zoom: 100% ; }
@-ms-viewport { user-zoom: fixed ; } @viewport { user-zoom: fixed ; }
</style>
<script src="cordova.js"></script>
<script src="js/app.js"></script>
<script src="xdk/init-dev.js"></script>
<script src="js/main.js"></script>
</head>
<body>
<input type='button' value='OnClick' id='btn1' onclick='pushNotify();'/>
<br>
</body>
</html>
The following is the main.js contain :
function pushNotify()
{
var pushObj = PushNotification.init({
android: {
senderID: "xxxxxxxxxxxxxx" // got the Sender ID from google developer console.
},
ios:
{
alert: "true",
badge: "true",
sound: "true"
},
windows: {}
});
pushObj.on('registration', function(data)
{
alert('success : '+data.registrationId);
});
pushObj.on('notification', function(data)
{
alert('notification DATA : '+JSON.stringify(data));
alert('Data Message : '+data.message);
alert('Data Title : '+data.title);
push.finish(function () {
alert('finish successfully called');
});
});
pushObj.on('error', function(e) {
alert('Error Message : '+e.message);
});
}
I have build the .apk file and installed in the phone.
On click of button , I am able to get Registration ID.
For testing push notification, I have used online GCM tool from the following link : http://techzog.com/development/gcm-notification-test-tool-android/
In this link , I have provided the proper server API key and Registration ID. On submitting these details, I am getting a success message along with multicast id and message id.
But didn't receive any notification in the phone.
Please help me or suggest something whether I am wrong somewhere and provide a solution .... Reply as soon as possible..
Thanks In Advance...
Regards,
Anjali Paria.
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Looking at the plugin.xml file for that plugin, it appears that it only supports Windows universal apps. This, it will only support Windows Phone 10 devices. Our current Windows Phone build system does not build Windows Phone 10 apps. You can use the EA version to build a Windows 10 universal app, which will run on Windows Phone 10 devices, but it will not run on Windows Phone 8.x devices.
Note, this is a Cordova and Microsoft limitation, this is not something we can change with the XDK.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks a lot for your information.
But I have got the notification event triggered after the successful registration.
I have one more question ..
I want to create this push notification app with one background service so that user can get the notification even the app is not open.
Just like WhatsApp Notification.
Is it possible in intel XDK to create an app which can have one background service for android?
If anyone knows the answer .. Please reply as soon as possible.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This would depend on the plugin you are using. I cant speak for this plugin, but I have used PushWoosh previously and their plugin does allow you to get push notifications in the background. So I would check the documentation for the plugin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I used the onesignal push service with the XDK,works pretty well.
Easy to setup, bunch of functionality,and it is 100% free.
(I have no relation to these guys)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page