{"_id":"5b3de28e8b6a810003c47d65","project":"55dd9f2e0efd5821000d54d9","version":{"_id":"55dd9f4dab0e4d210045aae9","__v":45,"project":"55dd9f2e0efd5821000d54d9","createdAt":"2015-08-26T11:13:17.024Z","releaseDate":"2015-08-26T11:13:17.024Z","categories":["55dd9f4dab0e4d210045aaea","55ddb5fa9067202b00ddff6f","55e0472c6bad670d0081f213","55e04764a44fae0d00214671","55e047a9a44fae0d00214672","55e047b258c5460d0076a9a7","55e95e337fc27b2d00d32cf2","55e979bda7ca823900ad549a","55edb8c18dcb210d0056900b","55f0365c8563861700a33765","55f03677d58f9b1900acf996","55f036938eeefc23001ea5de","55f036a38563861700a33767","55f036c08563861700a33769","55f036d02911b72100482cd7","55f036e92911b72100482cd9","55f036fa8563861700a3376b","55f0370ee507711900e58c69","55f0371df6101b1900c70700","55f0374f2911b72100482cdb","55f0375e2911b72100482cdc","560eb0f659cb8d0d0015cd52","560eb25239fad419002ae1e0","561fb64d4d67490d00804b2a","562b9f775a39cd0d009aff22","562ba0505a39cd0d009aff23","562ba149d56bc30d00f0cb18","562ba595f68a5f0d007b1f3b","562ba78fd56bc30d00f0cb1b","562ba8b95a39cd0d009aff27","562baadf6562140d001501d2","562bab37f68a5f0d007b1f3d","562bc1bf9ebc950d000f7523","562bc99ced4bea0d00c11dfa","562bd29c1b98640d00714520","562bd5875a39cd0d009aff60","562bdfabff2da50d002c0aaf","562be0bd5a39cd0d009aff75","57a0b476d8313e1900454439","5b19051beece890003020163","5b34ded01cb20f000391ad6d","5b3a325acffe770003fd29e5","5b3c737a7f7b890003365501","5b3c929b367036000391b11e","5b7c1e210dc2e20003871521"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2"},"category":{"_id":"5b34ded01cb20f000391ad6d","project":"55dd9f2e0efd5821000d54d9","version":"55dd9f4dab0e4d210045aae9","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2018-06-28T13:12:48.898Z","from_sync":false,"order":2,"slug":"push-notifications","title":"Push notifications"},"user":"5a251846c297dc0012e531cd","githubsync":"","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-07-05T09:19:10.578Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"[block:html]\n{\n  \"html\": \"<a id=\\\"in-dotmailer\\\"></a>\\n<div id=\\\"userMap\\\">\\n<div class=\\\"content\\\"><a href=\\\"https://developer.dotmailer.com/v2/docs/creating-a-push-notification-profile#in-dotmailer\\\"><div class=\\\"box box1 active\\\">Create a push notification profile in dotmailer</div></a></div>\\n<div class=\\\"arrow\\\">→</div>\\n<div class=\\\"content\\\"><a href=\\\"https://developer.dotmailer.com/v2/docs/creating-a-json-web-token\\\"><div class=\\\"box box2\\\">Create a class or function that generates a JSON Web Token</div></a></div>\\n<div class=\\\"arrow\\\">→</div>\\n<div class=\\\"content\\\"><a href=\\\"https://developer.dotmailer.com/v2/docs/setting-up-push-notifications#section-mobile-sdk-options\\\"><div class=\\\"box box3\\\">Use one of our mobile SDKs in your app</div></a></div>\\n<div class=\\\"clearfix\\\"></div></div>\\n\\n<style>\\n  .box {\\n    padding: 10px;\\n    border: 2px solid #000;\\n    width: 120px;\\n    height: 120px;\\n    background-color: #EAEAEA;\\n    hyphens: auto;\\n    float: left;\\n    font-size: 12px;\\n}\\n\\n.box:hover {\\n    background-color: #82bc42;\\n}\\n\\n.box.active {\\n    background-color: #82bc42;\\n}\\n\\n#userMap {\\n    overflow-x: auto;\\n    overflow-y: auto;\\n    padding: 20px;\\n    min-width: 770px;\\n}\\n\\n#userMap a:hover {\\n    text-decoration: none;\\n  }\\n\\ndiv.arrow {\\n    max-width: 50px;\\n    margin-left: 15px;\\n    margin-right: 15px;\\n    font-size: 50px;\\n}\\n\\n\\n#userMap div.arrow, #userMap div.content {\\n    float: left;\\n}\\n\\n.clearfix {\\n    clear: both;\\n}\\n\\n\\n#userMap div.arrow {\\n    position: relative;\\n    top: 45px;\\n}\\n\\n.box1 {\\n    margin-left:0px;\\n}\\n\\ndiv.box.box1 {\\n    margin-left: -20px;\\n}\\n\\n</style>\"\n}\n[/block]\nA push notification profile is a way to let dotmailer know about your app.\n\nYou can have only one profile, which can be set up to send push notifications to both Android and iOS devices.\n\n1. Click the **person-and-cog** icon, and go to **Channel management** > **Push Notification** > **New profile**\n\n2. In the 'Authentication' section, make a note of the values for each field. You'll use these values to create a [JSON Web Token (JWT)](doc:creating-a-json-web-token) in your app and pass that token to our mobile SDK.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/744188a-Channel_management_push_notification_profile_-_Authentication.png\",\n        \"Channel management_push notification profile - Authentication.png\",\n        600,\n        256,\n        \"#ebebe9\"\n      ]\n    }\n  ]\n}\n[/block]\n3. [Enter your FCM credentials](#section-entering-your-fcm-credentials-in-dotmailer) and/or [enter your APNs credentials](#section-entering-your-apns-credentials-in-dotmailer), depending on the operating system that your app was built for\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Have you got two apps?\",\n  \"body\": \"If you set up your push notification profile for both Android and iOS, each time a push notification is sent from dotmailer, both of your apps receive the same notification.\"\n}\n[/block]\n\n[block:embed]\n{\n  \"html\": false,\n  \"url\": \"https://login.dotmailer.com/login.aspx?ReturnUrl=%2fchannels%2f15%2fprofiles\",\n  \"title\": \"Login\",\n  \"favicon\": \"https://i.emlfiles.com/themeitems/1/files/0503a.ico?636657028912700000&unauth=true\",\n  \"image\": \"https://i.emlfiles.com/themeitems/1/files/cb2df.png\",\n  \"iframe\": true,\n  \"width\": \"100%\",\n  \"height\": \"500px\"\n}\n[/block]\n## Entering your FCM credentials in dotmailer\n\nOur Android SDK uses [Firebase Cloud Messaging (FCM)](https://firebase.google.com/docs/cloud-messaging/) to send push notifications to your Android app users. Therefore, you need to give us some details about your Firebase project.\n\nYou need to have the [Firebase console](https://console.firebase.google.com/u/0/?pli=1) open.\n\nIf you don't have a Firebase project, create one.\n\n1. In the Firebase console, click the **cog **icon and go to **Project settings**\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/c1a85db-Firebase_project_settings.jpg\",\n        \"Firebase_project settings.jpg\",\n        300,\n        142,\n        \"#e2e6e6\"\n      ]\n    }\n  ]\n}\n[/block]\n2. In the **General **tab, copy your package name and paste it into the 'Name' field in dotmailer\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Don't see your package name?\",\n  \"body\": \"If you don't see your package name in the **General** tab, you need to click **Add Firebase to your Android app**.\\n\\nComplete only steps 1 and 2 (register your app, and download your config file).\"\n}\n[/block]\n3. In the **Cloud Messaging** tab, copy your server key and paste it into the 'Server key' field in dotmailer\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/d0423b4-Firebase_server_key.jpg\",\n        \"Firebase_server key.jpg\",\n        600,\n        196,\n        \"#eeeeee\"\n      ]\n    }\n  ]\n}\n[/block]\n4. Click **Save** \n\nYou now have a value for the ['API space ID' field](doc:creating-a-push-notification-profile#section-finding-your-api-space-id), which you'll need to initialise an SDK.\n\n## Entering your APNs credentials in dotmailer\n\nOur iOS SDK uses the Apple Push Notification Service (APNs) to send push notifications to your contacts. Therefore, you need to give us your APNs details.\n\nYou need to have your Apple Developer Portal open.\n\nIf you don't have an app ID that has the 'Push Notifications' service enabled, create one.\n\n1.  In your Apple Developer Portal, create a new certificate of type **Apple Push Notification Service SSL (Sandbox and Production)** and upload that certificate to the 'Private key' field on your dotmailer profile page\n\n2. In the 'Key ID' field in dotmailer, enter the value of your [private key's ID](https://developer.apple.com/account/ios/authkey/)\n\n3. In the 'Team ID' field in dotmailer, enter the value of your [team ID](https://developer.apple.com/account/#/membership/)\n\n4. Click **Save** \n\nYou now have a value for the ['API space ID' field](doc:creating-a-push-notification-profile#section-finding-your-api-space-id), which you'll need to initialise an SDK.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/5a640ab-Channel_management_push_notification_profile_-_APNS.png\",\n        \"Channel management_push notification profile - APNS.png\",\n        600,\n        210,\n        \"#eaeae9\"\n      ]\n    }\n  ]\n}\n[/block]\n## Finding your API space ID\n\nThe API space ID is used to initialise our mobile SDKs.\n\nThis ID is at the bottom of your push notification profile page.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/d18fc17-Channel_management_push_notification_profile_-_API_space_ID.png\",\n        \"Channel management_push notification profile - API space ID.png\",\n        764,\n        158,\n        \"#e6e6e5\"\n      ]\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"creating-a-push-notification-profile","type":"basic","title":"Creating a push notification profile in dotmailer"}

Creating a push notification profile in dotmailer


[block:html] { "html": "<a id=\"in-dotmailer\"></a>\n<div id=\"userMap\">\n<div class=\"content\"><a href=\"https://developer.dotmailer.com/v2/docs/creating-a-push-notification-profile#in-dotmailer\"><div class=\"box box1 active\">Create a push notification profile in dotmailer</div></a></div>\n<div class=\"arrow\">→</div>\n<div class=\"content\"><a href=\"https://developer.dotmailer.com/v2/docs/creating-a-json-web-token\"><div class=\"box box2\">Create a class or function that generates a JSON Web Token</div></a></div>\n<div class=\"arrow\">→</div>\n<div class=\"content\"><a href=\"https://developer.dotmailer.com/v2/docs/setting-up-push-notifications#section-mobile-sdk-options\"><div class=\"box box3\">Use one of our mobile SDKs in your app</div></a></div>\n<div class=\"clearfix\"></div></div>\n\n<style>\n .box {\n padding: 10px;\n border: 2px solid #000;\n width: 120px;\n height: 120px;\n background-color: #EAEAEA;\n hyphens: auto;\n float: left;\n font-size: 12px;\n}\n\n.box:hover {\n background-color: #82bc42;\n}\n\n.box.active {\n background-color: #82bc42;\n}\n\n#userMap {\n overflow-x: auto;\n overflow-y: auto;\n padding: 20px;\n min-width: 770px;\n}\n\n#userMap a:hover {\n text-decoration: none;\n }\n\ndiv.arrow {\n max-width: 50px;\n margin-left: 15px;\n margin-right: 15px;\n font-size: 50px;\n}\n\n\n#userMap div.arrow, #userMap div.content {\n float: left;\n}\n\n.clearfix {\n clear: both;\n}\n\n\n#userMap div.arrow {\n position: relative;\n top: 45px;\n}\n\n.box1 {\n margin-left:0px;\n}\n\ndiv.box.box1 {\n margin-left: -20px;\n}\n\n</style>" } [/block] A push notification profile is a way to let dotmailer know about your app. You can have only one profile, which can be set up to send push notifications to both Android and iOS devices. 1. Click the **person-and-cog** icon, and go to **Channel management** > **Push Notification** > **New profile** 2. In the 'Authentication' section, make a note of the values for each field. You'll use these values to create a [JSON Web Token (JWT)](doc:creating-a-json-web-token) in your app and pass that token to our mobile SDK. [block:image] { "images": [ { "image": [ "https://files.readme.io/744188a-Channel_management_push_notification_profile_-_Authentication.png", "Channel management_push notification profile - Authentication.png", 600, 256, "#ebebe9" ] } ] } [/block] 3. [Enter your FCM credentials](#section-entering-your-fcm-credentials-in-dotmailer) and/or [enter your APNs credentials](#section-entering-your-apns-credentials-in-dotmailer), depending on the operating system that your app was built for [block:callout] { "type": "info", "title": "Have you got two apps?", "body": "If you set up your push notification profile for both Android and iOS, each time a push notification is sent from dotmailer, both of your apps receive the same notification." } [/block] [block:embed] { "html": false, "url": "https://login.dotmailer.com/login.aspx?ReturnUrl=%2fchannels%2f15%2fprofiles", "title": "Login", "favicon": "https://i.emlfiles.com/themeitems/1/files/0503a.ico?636657028912700000&unauth=true", "image": "https://i.emlfiles.com/themeitems/1/files/cb2df.png", "iframe": true, "width": "100%", "height": "500px" } [/block] ## Entering your FCM credentials in dotmailer Our Android SDK uses [Firebase Cloud Messaging (FCM)](https://firebase.google.com/docs/cloud-messaging/) to send push notifications to your Android app users. Therefore, you need to give us some details about your Firebase project. You need to have the [Firebase console](https://console.firebase.google.com/u/0/?pli=1) open. If you don't have a Firebase project, create one. 1. In the Firebase console, click the **cog **icon and go to **Project settings** [block:image] { "images": [ { "image": [ "https://files.readme.io/c1a85db-Firebase_project_settings.jpg", "Firebase_project settings.jpg", 300, 142, "#e2e6e6" ] } ] } [/block] 2. In the **General **tab, copy your package name and paste it into the 'Name' field in dotmailer [block:callout] { "type": "info", "title": "Don't see your package name?", "body": "If you don't see your package name in the **General** tab, you need to click **Add Firebase to your Android app**.\n\nComplete only steps 1 and 2 (register your app, and download your config file)." } [/block] 3. In the **Cloud Messaging** tab, copy your server key and paste it into the 'Server key' field in dotmailer [block:image] { "images": [ { "image": [ "https://files.readme.io/d0423b4-Firebase_server_key.jpg", "Firebase_server key.jpg", 600, 196, "#eeeeee" ] } ] } [/block] 4. Click **Save** You now have a value for the ['API space ID' field](doc:creating-a-push-notification-profile#section-finding-your-api-space-id), which you'll need to initialise an SDK. ## Entering your APNs credentials in dotmailer Our iOS SDK uses the Apple Push Notification Service (APNs) to send push notifications to your contacts. Therefore, you need to give us your APNs details. You need to have your Apple Developer Portal open. If you don't have an app ID that has the 'Push Notifications' service enabled, create one. 1. In your Apple Developer Portal, create a new certificate of type **Apple Push Notification Service SSL (Sandbox and Production)** and upload that certificate to the 'Private key' field on your dotmailer profile page 2. In the 'Key ID' field in dotmailer, enter the value of your [private key's ID](https://developer.apple.com/account/ios/authkey/) 3. In the 'Team ID' field in dotmailer, enter the value of your [team ID](https://developer.apple.com/account/#/membership/) 4. Click **Save** You now have a value for the ['API space ID' field](doc:creating-a-push-notification-profile#section-finding-your-api-space-id), which you'll need to initialise an SDK. [block:image] { "images": [ { "image": [ "https://files.readme.io/5a640ab-Channel_management_push_notification_profile_-_APNS.png", "Channel management_push notification profile - APNS.png", 600, 210, "#eaeae9" ] } ] } [/block] ## Finding your API space ID The API space ID is used to initialise our mobile SDKs. This ID is at the bottom of your push notification profile page. [block:image] { "images": [ { "image": [ "https://files.readme.io/d18fc17-Channel_management_push_notification_profile_-_API_space_ID.png", "Channel management_push notification profile - API space ID.png", 764, 158, "#e6e6e5" ] } ] } [/block]