iOS push notifications: iOS logs "NOT delivering non-notifying push notification" - ios

Why is iOS not delivering push notifications to my device?
I am sending a push notification using curl, like so:
curl -v \
--http2 \
--header "apns-push-type: alert" \
--header "apns-priority: 10" \
--header "authorization: bearer $jwt" \
--header "apns-topic: ${BUNDLEID}" \
--data '{"aps": {"content-available": 1, "interruption-level": "active"}, "alert": {"title":"title", "body": "body"}}' \
"${URL}"
Unfortunately, when I look in Console.app, I see the log:
[uk.orth.pushExampleTemporary] Received remote notification request FDCA-F040 [ waking: 0, hasAlertContent: 0, hasSound: 0 hasBadge: 0 hasContentAvailable: 1 hasMutableContent: 0 pushType: Alert]
[uk.orth.pushExampleTemporary] NOT requesting DUET deliver content-available, non-notifiying push notification FDCA-F040 [pushType: Alert willNotifyUser: 0]
[uk.orth.pushExampleTemporary] NOT delivering non-notifying push notification FDCA-F040 [pushType: Alert willNotifyUser: 0]

JSON structure problem
I've noticed that I set the data payload to be something slightly wrong 😢, which was caused by formatting my payload in bash instead of a type in programming language.
The line containing the payload (--data) should look like:
--data '{"aps": {"content-available": 1, "alert": {"title":"title", "body": "body"}}}' \
Avoiding this problem in the future
I've moved over to using a json file (ios_alert_message.json) to avoid these types of errors, using the curl command:
curl -v \
--http2 \
--header "apns-push-type: alert" \
--header "apns-priority: 10" \
--header "authorization: bearer $jwt" \
--header "apns-topic: ${BUNDLEID}" \
--header "Content-Type: application/json" \
--data #"$CURRENT_DIR/ios_alert_message.json" \
"${URL}"

Related

Get Statewise Location report from Google Ads

I want to get the report as shown here https://prnt.sc/oG7ms7tOdVfH
The input is Country = USA
Date from and Date to
But this gives non US states and it doesnt summarize the resuly by state names (not the state IDs)
Can anyone help me to get the REST API?
curl "https://googleads.googleapis.com/v10/customers/${CUSTOMER_ID}/googleAds:searchStream" \
--header "Content-Type: application/json" \ --header "developer-token: ${DEVELOPER_TOKEN}" \
--header "login-customer-id: ${MANAGER_CUSTOMER_ID}" \
--header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \
--data '{ "query": "
SELECT
PERFORMANCE COST
FROM LOCATION
WHERE
COUNTRY = 'USA' AND
segments.date BETWEEN 20220101 AND 20220430
" }'

Apple voip notification expiration doesn't work

I send voip notifications using curl to apns server. I use the following script:
curl -v \
--header "apns-topic: **.voip" \
--header "apns-priority: 10" \
--header "apns-push-type: voip" \
--header "apns-expiration: 0" \
--cert-type P12 --cert *** \
--data '{}' \
--http2 \
https://${APNS_HOST_NAME}/3/device/${DEVICE_TOKEN}
I disable wifi and cellular data for 1 min and send voip notication.
apns-expiration header works fine when APNS_HOST_NAME is api.sandbox.push.apple.com - I don't receive voip notification.
But when APNS_HOST_NAME is api.push.apple.com - I receive voip notification when I enable wifi back after 1 min, 1.5 min ...
I'm not sure what is wrong and what causes such difference in sandbox and production modes. Does anyone know how to solve this?
Try removing the aps json block from the data payload
"aps": {
"alert": ""
}

You must use HTTPS while generating Kong client credentials

Can anyone please help me out. I'm getting error while generating KONG client credentials on HTTP port 8000.
{
"error_description": "You must use HTTPS",
"error": "access_denied"
}
I have added trusted_ips = 0.0.0.0/0,::/0 in kong.conf also, but it didn't work.
You should do it over https(using port 8443 instead of 8000).If youre using localhost Do something like:
curl -X POST \
--url "https://127.0.0.1:8443/<route name>/oauth2/token " \
--header "Host: <route host>" \
--data "grant_type=password" \
--data "client_id=<clientid>" \
--data "client_secret=<clientsecret>" \
--data "provision_key=<provision_key>"\
--data "redirect_uri=http://localhost/cb/" \
--data "authenticated_userid=<userid>" \
--insecure
you can follow this link for further details on how to go about this

How to get build status of PR using BitBucket API?

Not getting Build job details/status of the PR when using Bitbucket API for any pull request
Here is my API URL:
https://example.com/rest/api/1.0/projects/{projectkey}/repos/{reposlug}/pull-requests/{pullrequestID}
How Build status looks like on GUI:
I also tried below methods to get the Build status but no luck
/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/settings/pull-requests
/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/settings/hooks
So I wanted to get whether build status of any PR whether it is Success or Fail
Thanks in Advance for your answers.
The build status is on the commit, not on the PR. First you should find the latest commit of the source branch by calling /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}. see the docs for more details
Once you have the commit id you can query the build-status api by calling /rest/build-status/1.0/commits/{commitId}. See the docs for more details
Using API 2.0
Get statuses: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pullrequests/%7Bpull_request_id%7D/statuses
Set status: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/commit/%7Bnode%7D/statuses/build
Example:
curl --request GET \
--url https://api.bitbucket.org/2.0/repositories/piavita/com.piavita-vet.ios/pullrequests/300/statuses \
--header 'Authorization: Basic SecretKey' \
--header 'Content-Type: application/json'
curl --request POST \
--url https://api.bitbucket.org/2.0/repositories/piavita/com.piavita-vet.ios/commit/8619291af393/statuses/build \
--header 'Authorization: Basic SecretKey' \
--header 'Connection: keep-alive' \
--data '{\n "url": "http://jenkins.ddns.net:8080/job/jobName/123/",\n "state": "SUCCESSFUL",\n "key": "JENKINS"\n}'

Updating Parse installation object removes it

I create an installation object using a REST API call like this :
curl -X POST \
-H "X-Parse-Application-Id: ${APPLICATION_ID}" \
-H "X-Parse-REST-API-Key: ${REST_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"deviceType": "ios",
"deviceToken": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"channels": [
""
]
}' \
https://<your.parseprovider.here>/1/installations
The installation object is created and is indicated by the response :
{
"objectId": "EmqGmZXGEm",
"createdAt": "2017-02-15T10:13:18.647Z"
}
Now let's say I want to update the channels field to include the "foo" channel in the installation object, I could simply issue a call like :
curl -X PUT \
-H "X-Parse-Application-Id: ${APPLICATION_ID}" \
-H "X-Parse-REST-API-Key: ${REST_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"channels": [
"",
"foo"
]
}' \
https://<your.parseprovider.here>/1/installations/EmqGmZXGEm
Success is then indicated by the response :
{
"updatedAt": "2017-02-15T10:18:31.055Z"
}
However, when I execute the PUT call like this (as in the REST API docs, note the inclusion of the deviceType and deviceToken fields) :
curl -X PUT \
-H "X-Parse-Application-Id: ${APPLICATION_ID}" \
-H "X-Parse-REST-API-Key: ${REST_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"deviceType":"ios",
"deviceToken":"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"channels": [
"",
"foo"
]
}' \
https://<your.parseprovider.here>/1/installations/EmqGmZXGEm
I now get the following response :
{
"code": 101,
"error": "Object not found."
}
The installation object has now suddenly been deleted from the Parse server database.
This seems to happen as soon as the deviceToken field is included in the PUT request.
Is this supposed to happen, or am I missing something? I am using a Parse API for Delphi which is breaking because of this "phenomenon". I would rather not hack the API if the error is due to a Parse bug that should be fixed on the server side.
Try PATCH instead of PUT. See table. Both PUT and PATCH can be used for update.

Resources