AppCenter Push Notification – Part 2

In this article, we’ll look at sending device-specific notifications with AppCenter open api.

If you want to integrate AppCenter utilities into your back-end system, the appcenter open api layer will help you.

Firstly you need to get APIToken for open api authorization. You can learn by following the steps on the site

All methods are available under notification category and we’ll use push send method

 

I will use the postman for test

Our sample url is https://api.appcenter.ms/v0.1/apps/{owner_name}/{app_name}/push/notifications we need to fill owner_name and app_name fields

You can find your owner_name and app_name in your project url.

owner_name : Yigit

app_name : VSAppCenterPushNotification

This url should be : https://api.appcenter.ms/v0.1/apps/Yigit/VSAppCenterPushNotification/push/notifications

Now we can send notification all devices or device-specific

Let’s try!

We need to set X-API-Token in postman

You can set additionalProp1, additionalProp2 and additionalProp1 if you want.

Let’s try to how to send device-specific notification

We have to fill notification_target in request body

Firstly we need to get device id. We can get the device id using GetInstallIdAsync method.

var dId = await AppCenter.GetInstallIdAsync();

Our request should be;

You can find installed Id and more information in this site

Let’s check appcenter

You can send push notification to an audience

“notification_target” : { “type” : “audiences_target”, “audiences” : [“a-1”, “a-2”] }

Yiğit

Xamarin Developer, Consultant & Architect. Community Leader and Director of Xamarin Türkiye

3 Comments

You can post comments in this post.


  • Hi, thanks for the article it helped very much..
    I want to present custom actions on Xamarin.iOS with App Center. As far as I know I should specify an action category in my “Remote Notification Payload” to do that on iOS. I could not find any sample or solution with App Center for that. Do you know how can i do it with App Center?
    Thanks in advance

    Dilâra Tezel 3 hafta ago Reply


    • Hi,
      Yes you can! Firstly you have to create an APPID and key for auth. Than open your key file with a notepad and copy the authentication token and paste pushtoken input in AppCenter portal. If you have time I’ll write a article this weekend about this.

      Yiğit 2 hafta ago Reply


      • I can take push notifications on iOS with App Center at present. I just want to show buttons on my remote notifications but i could not do that yet. If you can mention about it in your article i really appreciate that, thank you very much.

        Dilâra Tezel 2 hafta ago Reply


Post A Reply