Oracle Help Center | Oracle Push Cloud Service (Standalone) title

Step-by-Step Setup Instructions

This topic provides detailed instructions for integrating your Windows mobile app with Oracle Push Cloud Service.

Before You Continue

Step 1: Obtain Windows Notification Service Credentials & Authenticate Your App

If you do not have your credentials and are unsure how to get them, go to Get Windows Credentials.

If you have your app's Client Secret and Package SID, continue with this topic.

Step 2: Install the SDK & Supporting Files

[2.1] Log in to your PushIO Account using the PushIO Manager Web Dashboard, and then add a Windows 8 Platform to your app.

"Adding Window 8 platform image"

[2.2] On the platform edit page, enter the Package Security Identifier (SID) and Client secret for your app (refer to Step 1), and then click Done.

"Adding Window 8 app credentials image"

Once you have added the Package SID and Client Secret for your app, the system generates a pushio_config.json file and displays a download link on the page. This JSON file comes packaged with your app's Windows credentials, so that Oracle Push Cloud Service can properly target your application.

[2.3] Download the pushio_config.json file and include it in your project's folder in Visual Studio.

"Download push_config.json image"

[2.4] In your project's folder in Visual Studio, include the pushio_config.json file change its Build Action to Content.

"Visual Studio json included image""

[2.5] Download the PushIOManager files and extract them to the desktop. Once downloaded, right-click the References folder in your project and click "Add Reference..."

[2.6] In the reference manager, browse to the PushIOManager files you just extracted. Add the files PushIOManager.dll and PushIORuntimeComponent.winmd, and ensure that they were added to the references folder.

"PushIO files in Reference Manager image"

NOTE: If Visual Studio displays a message stating, "A reference to a higher version or incompatible assembly cannot be added to the project", try unblocking the .DLL file in Windows Explorer manually.

Step 3: Integrate PushIO Manager

Add required capabilities to your App packaging (Package.appxmanifest):

[3.1] Right click on your project in Solution explorer. From the menu displayed, choose Store, and then choose Associate App with the Store....

This step associates your app created in Visual Studio with the app generated in Step 1. App-specific identities are added automatically to the project's App Manifest file. This step also adds files to your project (Package_StoreKey.pfx, Package.StoreAssociation.xml, and the like).

"Visual Studio associate app image""

[3.2] Double-click your Package.appxmanifest file. Select Capabilities, and then select the Internet(Client) check box, the Internet(Client and Server) check box, and the Location check box.

"Visual Studio set capabilities image""

[3.3] Next, on the Declarations tab for Package.appxmanifest, select Background Tasks from the available declarations, and then click Add. In the Properties section, locate and select the Push Notification check box. Also, remember to add PushIORuntimeComponent.PushIOBackgroundTask as the Entry point. This handles notifications when the app is in the background.

"Visual Studio set declarations image""

Add code to initialize your application on startup:

[3.4] Open App.xaml.cs and add the following code to the OnLaunched function:

protected override void OnLaunched(LaunchActivatedEventArgs e)
{
    PushIOManager.Initialize(RootFrame);
    PushIOManager = PushIOManager.getInstance();
    PushIOManager.EnsureRegistration();
    PushIOManager.CheckIfToastLaunchedApp(e);
}

[3.5] Enable Push (Opt-In for Push Notifications) - Required for Windows Phone Marketplace

Windows Phone Marketplace requires the user to opt-in for Push Notifications. PushIOManager contains a property named PushEnabled (set to false by default) that helps developers comply with this requirement.

There are two ways to enable push:

[3.6] Register for NotificationReceived events:

PushIOManager.NotificationReceived += (sender, args) =>
    {
        XmlNodeList texts = args.ToastNotification.Content.GetElementsByTagName("text");
        if (texts != null && texts.Length > 0)
        {
            String message = texts[0].InnerText;
            Deployment.Current.Dispatcher.BeginInvoke(() =>
            {
                MessageBox.Show(message);
            });
        }
    };

Step 4: Ready, Set, Push!

Now that you've integrated the Oracle Push Cloud Service SDK, it's time to test your integration.

  1. Log into the Web Dashboard.
  2. Navigate to the Push tab.
  3. Choose All Active Devices from the Audience dropdown menu.
  4. Type in a message and click Send Now.

What's Next?

Now that you have completed the basic configuration and have tested push notifications, we recommend that you continue to the following topics: