OneSignal Help & Documentation

Welcome to the OneSignal New IA developer hub. You'll find comprehensive guides and documentation to help you start working with OneSignal New IA as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    Support

Intel XDK Setup

OneSignal Intel XDK Setup Guide. Works with iOS, Android (and derivatives like Amazon) and Windows Phone 8.1.

For Developers

Required For Setup

  • A OneSignal Account if you do not already have one
  • Your OneSignal App ID, available in Keys & IDs
  • iOS - An iOS device (iPhone, iPad, iPod Touch) to test on. The Xcode simulator doesn't support push notifications so you must test on a real device.
  • iOS - You MUST have a Mac with a new version of Xcode

Update SDK

If you already have an app with the Intel XDK, your app should remain up to date with the latest OneSignal SDK since your project is built remotely. If you have not set up an app yet, follow the instructions below.


Setup SDK

Generate Credentials

Before setting up Intel XDK, you must generate the appropriate credentials for the platform(s) you are releasing on:

iOS - Generate an iOS Push Certificate

Android - Generate a Google Server API Key

Amazon - Generate an Amazon API Key

1. Import OneSignal Plugin

1.1. Click the Projects menus in the top left and scroll down to "Cordova Hybrid Mobile App Settings". Expand "Plugin Management" and click "Add Plugins to this Project".

1.2. Select "Third-Party Plugins" then "Git repo" as the Plugin source.
Enter the following as the "Repo URL".

1.3. Windows Phone 8.1 - Open intelxdk.config.additions.xml and add the following lines.

<preference name="windows-target-version" value="8.1" />
<preference name="WindowsToastCapable" value="true" />

2. Add required code

2.1. Add the following to the first javascript file that loads with your app.

  • This is <project-dir>/www/js/index.js for most Cordova projects.
  • Add this to your app.js.
// Add to index.js or the first page that loads with your app.
// For Intel XDK and please add this to your app.js.

document.addEventListener('deviceready', function () {
  // Enable to debug issues.
  // window.plugins.OneSignal.setLogLevel({logLevel: 4, visualLevel: 4});
  
  var notificationOpenedCallback = function(jsonData) {
    console.log('notificationOpenedCallback: ' + JSON.stringify(jsonData));
  };

  window.plugins.OneSignal
    .startInit("YOUR_APPID")
    .handleNotificationOpened(notificationOpenedCallback)
    .endInit();
  
  // Call syncHashedEmail anywhere in your app if you have the user's email.
  // This improves the effectiveness of OneSignal's "best-time" notification scheduling feature.
  // window.plugins.OneSignal.syncHashedEmail(userEmail);
}, false);

2.2 Update initialization parameters

Replace YOUR_APPID with your OneSignal AppId, available in Keys & IDs


Troubleshooting

If you run into any errors see Troubleshooting Cordova Variants, our our general Troubleshooting section.

  • Does NOT work with the Intel XDA Debug mode.

You're Done!

Next up: Send your first push notification via the OneSignal Dashboard


Intel XDK Setup

OneSignal Intel XDK Setup Guide. Works with iOS, Android (and derivatives like Amazon) and Windows Phone 8.1.

For Developers