Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sending push notifications to app in limited setup - fake_push_profile not found Ionic

I have followed the instructions to setup a limited setup for push notifications at this article: http://docs.ionic.io/v2.0.0-beta/docs/push-limited-setup

I've got a device ID, and I've registered an API token with Ionic. I have the app running in my browser and am attempting to run

curl -X POST -H "Authorization: Bearer API_TOKEN" -H "Content-Type: application/json" -d '{
    "tokens": ["DEV_DEVICE_TOKEN"],
    "profile": "fake_push_profile",
    "notification": {
        "message": "Hello World!"
    }
}' "https://api.ionic.io/push/notifications"

In a bash console. However I'm getting an error that looks like this:

"error": {"link": null, "type": "BadRequest", "message": "Security Profile 'fake_push_profile' not found."}}
like image 847
Joshua Terrill Avatar asked May 04 '16 23:05

Joshua Terrill


1 Answers

Got the solution.

You need to create a Profile in your app Dashboard.

Navigate to : Your app setup Page Online

Create a profile and Name it fake_push_profile .

In your .sh file from your where your are sending push you need to enter fake_push_profile in your profile key:

 curl -X POST -H "Authorization: Bearer Your_Token" -H "Content-Type: application/json" -d '{
"tokens": ["Device_Token"],
"profile": "fake_push_profile",
"notification": {
    "message": "Hello World!"
}
 }' "https://api.ionic.io/push/notifications"

That's all you need to do.

Here is the screenshot what I did and it works like a charm.

I did it for iOS.

enter image description here

like image 169
Rahul Avatar answered Oct 25 '22 07:10

Rahul