Skip to content

Latest commit

 

History

History
177 lines (121 loc) · 10.4 KB

File metadata and controls

177 lines (121 loc) · 10.4 KB
copyright
years
2015, 2020
lastupdated 2020-06-18
keywords push notifications, push notification, notifications, service instance, cordova application
subcollection mobilepush

{:external: target="_blank" .external} {:shortdesc: .shortdesc} {:codeblock: .codeblock} {:pre: .pre} {:screen: .screen} {:tsSymptoms: .tsSymptoms} {:tsCauses: .tsCauses} {:tsResolve: .tsResolve} {:tip: .tip} {:important: .important} {:note: .note} {:download: .download} {:java: .ph data-hd-programlang='java'} {:ruby: .ph data-hd-programlang='ruby'} {:c#: .ph data-hd-programlang='c#'} {:objectc: .ph data-hd-programlang='Objective C'} {:python: .ph data-hd-programlang='python'} {:javascript: .ph data-hd-programlang='javascript'} {:php: .ph data-hd-programlang='PHP'} {:swift: .ph data-hd-programlang='swift'} {:reactnative: .ph data-hd-programlang='React Native'} {:csharp: .ph data-hd-programlang='csharp'} {:ios: .ph data-hd-programlang='iOS'} {:android: .ph data-hd-programlang='Android'} {:cordova: .ph data-hd-programlang='Cordova'} {:xml: .ph data-hd-programlang='xml'}

Configure a service instance

{: #push_step_2}

Ensure that you went through Obtain notification service provider credentials.

You can configure the service for Android apps, iOS apps, Chrome web apps, Chrome apps and extentions, Firefox web apps, and Safari web apps by selecting the Configure button in the respective tile.

Click the Menu icon (three vertical dots) in the respective configuration tile to Edit or Delete a configuration. The Menu icon appears only in the respective configuration tile if configuration details exist. {: note}

For Android apps

{: #push_step_2_Android}

Ensure that you went through Obtain notification service provider credentials to set up the FCM project and obtain your credentials.

To configure the service with FCM credentials for Android applications, complete the following steps:

  1. In the {{site.data.keyword.mobilepushshort}} service console, click Configure Service on the left navigation menu.

  2. In the Android tile, click Configure.

  3. In the side panel, update the FCM Push Credentials with the Sender ID/Project number and Server Key or Legacy Server Key. You can get these details from your FCM Project Settings > Cloud Messaging section.

    Configure Android apps

  4. Click Save. The {{site.data.keyword.mobilepushfull}} service is now configured.

After you have setup the service, you need to Set up the Push service client SDKs.

For iOS apps

{: #enable-push-ios-notifications}

To use the {{site.data.keyword.mobilepushshort}} service to send notifications, upload the .p12 certificates that you had created in Obtain notification service provider credentials. This certificate contains the private key and SSL certificates that are required to build and publish your application. You can also use the ReST API to upload an APNs certificate.

After the .cer file is in your key chain access, export it to your computer to create a .p12 certificate. {: note}

For more information about using the APNs, see iOS Developer Library: Local and Push Notification Programming Guide{: external}.

To set up APNs on the Push Notification service console, complete the steps:

  1. In the {{site.data.keyword.mobilepushshort}} service console, click Configure Service on the left navigation menu.

  2. In the iOS tile, click Configure.

  3. In the side panel, update the APNs Push Credentials information.

    • Select the certificate type: .p12 or .p8. If device is registered and environment type (Sandbox/Production) of certificate does not match, push will delete devices on message send - as it will be considered as invalid device. Remember to select correct environment. {: note}
    • Click Add file to upload the certificate that you have created.
    • If the certificate type is .p12, enter the password associated with the certificate file.
    • If the selected certificate type is .p8, enter values for Key id, Team id, and Bundle id associated with the certificate file.

    Configure iOS apps

  4. Click Save. The {{site.data.keyword.mobilepushfull}} service is now configured.

After you have setup the service, you need to Set up the Push service client SDKs.

For Chrome browser

{: #push_step_2_chrome}

To configure the service with credentials for your Chrome web app, complete the following steps:

  1. In the {{site.data.keyword.mobilepushshort}} service console, click Configure Service on the left navigation menu.

  2. In the Chrome tile, click Configure.

  3. In the side panel, update the Website URL of your website that will be registered to receive push notifications.

  4. Enter the Google server API Key.

    Configure Chrome browser apps

  5. Click Save. The {{site.data.keyword.mobilepushfull}} service is now configured.

After you set up the service, you need to Set up Push service client SDKs.

For Chrome apps and extensions

{: #push_step_2_chrome-apps}

Ensure that you have gone through Obtain notification service provider credentials to set up the FCM project and obtain your credentials.

To configure the service with FCM credentials for your Chrome apps and extensions, complete the following steps:

  1. In the {{site.data.keyword.mobilepushshort}} service console, click Configure Service on the left navigation menu.

  2. In the Chrome apps and extensions tile, click Configure.

  3. In the side panel, update the FCM Push Credentials with the Sender ID/Project number and Server Key or Legacy Server Key. You can get these details from your FCM Project Settings > Cloud Messaging section.

    Configure Chrome apps and extensions

  4. Click Save. The {{site.data.keyword.mobilepushfull}} service is now configured.

After you have setup the service, you need to Set up the Push service client SDKs.

For Firefox browser

{: #push_step_2_firefox}

To configure the service with credentials for your Firefox web app, complete the following steps:

  1. In the {{site.data.keyword.mobilepushshort}} service console, click Configure Service on the left navigation menu.

  2. In the Firefox tile, click Configure.

  3. In the side panel, update the Website URL of your website that will be registered to receive push notifications.

    Configure Firefox browser

  4. Click Save. The {{site.data.keyword.mobilepushfull}} service is now configured.

After you have set up the service, you need to Set up Push service client SDKs.

For Safari browser

{: #push_step_2_safari}

To use the {{site.data.keyword.mobilepushshort}} service to send notifications, upload the .p12 certificates that you had created in Obtain notification service provider credentials. This certificate contains the private key and SSL certificates that are required to build and publish your application. You can also use the ReST API to upload an APNs certificate.

After the .cer file is in your key chain access, export it to your computer to create a .p12 certificate. {: note}

For more information about using the APNs, see iOS Developer Library: Local and Push Notification Programming Guide{: external}.

To set up APNs on the Push Notification service console, complete the steps:

  1. In the {{site.data.keyword.mobilepushshort}} service console, click Configure Service on the left navigation menu.

  2. In the Safari tile, click Configure.

  3. In the side panel, update the following details:

    • Website name - This is the name that you have provided in the Notification center.
    • Website push ID - Update with the reverse-domain string for your Website Push ID. For example, web.com.acmebanks.www.
    • Website URL - Provide the URL of the website that should be subscribed to push notifications. For example, https://www.acmebanks.com.
    • URL Format String - The URL to resolve when the notification is clicked. For example, [https://www.acmebanks.com]. Ensure that the URL use the http or https scheme.
    • Safari web push certificate - Upload the .p12 certificate.
    • In the Password field, enter the password that is associated with the .p12 certificate file.
    • Optional: Upload the Notification icon of the size specified.

    Configure Safari browser apps

  4. Click Save. The {{site.data.keyword.mobilepushfull}} service is now configured.

After you set up the service for iOS applications, you need to Set up Push service client SDKs.

For Cordova applications

{: #push_step_2_b}

Cordova is a platform for building hybrid applications with JavaScript, CSS, and HTML. The {{site.data.keyword.mobilepushshort}} service supports development of Cordova-based iOS and Android applications.

To enable Cordova applications for receiving push notifications to your devices, go through {{site.data.keyword.mobilepushfull}} Cordova plug-in Push SDK{: external}.