Gcm send to apn when foreground and background. <- send ok
But if Force Quit Application, gcm not sended to apn. <- send not ok
When Force Quit Application, apn is possible send notification because, "APN Tester" is send notification Available.
< test condition >
iPhone 4
7.1.2
object c code(GcmExample.app)
use curl
< curl --header "Authorization: key=$server_api_key" \
--header Content-Type:"application/json" \
https://android.googleapis.com/gcm/send \
-d "{\"data\":{\"title\":\"title\"},\"notification\":{\"body\":\"noti test\",\"content_available\":true},\"to\":\"$token\"}" >
< etc use >
"GcmServerDemo" tool
"APN Tester" tool
You should try a message that has high APNS priority e.g.
curl --header "Authorization: key=$server_api_key" \
--header Content-Type:"application/json" \
https://android.googleapis.com/gcm/send \
-d "{
'data': { 'title': 'title' }, \
'notification': {'body': 'notitest' }, \
'content_available': true, \
'to': '$token', \
'priority': 10,
}"
You need to set the priority explicitly to 10 else GCM assumes normal APNS priority which can get highly delayed.
Here is the GCM reference where you can read about the priority field.
Related
https://dartfrog.vgv.dev/docs/tutorials/todos#summary
I got to this section, but I don't know how to get it to work at the end, so I can't get it to work.
in my browser
http://localhost:8080/todos
When I access the above url, [] is displayed, so I think it's working.
# Update a specific todo by id
curl --request PUT \
--url http://localhost:8080/todos/<id> \
--header 'Content-Type: application/json' \
--data '{
"title": "Take out trash!",
"isCompleted": true
}'
How can I check that the above part works?
The line you see there is a command you are supposed to run on your commandline.
If you use a newer version of windows you probably have curl already, if not, see How do I install and use cURL on Windows?
So you open your command prompt and enter
curl --request PUT --url http://localhost:8080/todos/<id> --header 'Content-Type: application/json' --data '{ "title": "Take out trash!", "isCompleted": true }'
where I guess the <id> part needs to be an id. So for example 1.
Please note that that is a tutorial for a backend in Dart. They are not commonly called an app. If you are looking to build a nice app for your device or webbrowser, with ui controls like input boxes and buttons, you are reading the wrong tutorial.
I have a simple request that I am sending to a JIRA server
curl \
-D- \
-u 'api_key_label:api_key' \
-X POST \
--data '{"fields": {"project":{"key": "my_proj"}, "issuetype": {"name": "Bug"}}}' \
-H "Content-Type: application/json" \
https://my_instance/rest/api/2/issue/
When I send the request I get the response
{"errorMessages":[],"errors":{"project":"Anonymous users do not have permission to create issues in this project. Please try logging in first."}}%
If anyone has any experience with this I would appreciate some advice. Is the -u parameter supposed to base64 encoded?
Python
import requests
from requests.auth import HTTPBasicAuth
import json
data = json.dumps({"fields": {"project":{"key": "VER"},"summary": "summary": {"name": "Bug"}}})
url = 'https://my_instance:8080/rest/api/2/issue/'
headers = {
'Content-Type': 'application/json'
}
response = requests.post(url,auth=('email_accoount','api_key'),data=data,headers=headers)
I'm creating a payment intent as per the Stripe documentation:
payment_intent = Stripe::PaymentIntent.create({
payment_method_types: ['card'],
amount: '1000',
currency: 'aud',
application_fee_amount: '10',
}, stripe_account: 'pi_1IwLlIJuxAkCMV')
When stripe_account is an Express account, the payment intent gets created and appears in the dashboard as expected.
But when stripe_account is a Standard account, the payment intent appears to be created and is visible in the console, but the payment intent is not visible in the stripe dashboard, and nor can it be retrieved with Stripe::PaymentIntent.retrieve(id):
Stripe::PaymentIntent.retrieve(payment_intent.id)
Stripe::InvalidRequestError: No such payment_intent: 'pi_1IwLlIJuxAkCMV'
from stripe-5.26.0/lib/stripe/stripe_client.rb:592:in `handle_error_response'
Question
Why does creating a payment intent work for express connected accounts but not standard connected accounts?
In your initial snippet, you likely meant to include an account id like acct_123 in the optional stripeAccount header (ref). That optional parameter also should be within an {} object/hash, though that appears to not be used in the example you linked.
Authenticating as one of your connected accounts like this creates the payment intent as a direct charge on the connected account itself (as described eslewhere on the doc you linked).
After creating a direct charge like this, you need to include that same stripeAccount header to authenticate during the retrieval:
Stripe::PaymentIntent.retrieve(payment_intent.id, { stripeAccount: 'acc'})
Edit to add: Confirming this curl example works as expected:
curl --request POST \
--url https://api.stripe.com/v1/payment_intents \
-u sk_test_123: \
--header 'Stripe-Account: acct_123' \
--data amount=10000 \
--data currency=usd \
--data confirm=true \
--data payment_method=pm_card_visa \
--data application_fee_amount=500
Creates pi_456, then:
curl --request GET \
--url https://api.stripe.com/v1/payment_intents/pi_456 \
-u sk_test_123: \
--header 'Stripe-Account: acct_123' \
I'm trying to create a request in Postman (prefer) to test the Push notification API out. My search mostly returned firebase or onesignal settings while I'm trying to send the request in raw directly to apple.
Can someone please help to setup and formulate a basic APNS request in postman?
I'm using this documentation page as a reference.
What I'm missing I think is where to specify the contents of the p12 file plus any other missing data.
I didn't get number 3 in the path variable.
:path =/3/device/00fc13adff785122b4ad28809a3420982341241421348097878e577c991de8f0
Listing 2 A POST request relying on a certificate
HEADERS
- END_STREAM
+ END_HEADERS
:method = POST
:scheme = https
:path = /3/device/00fc13adff785122b4ad28809a3420982341241421348097878e577c991de8f0
host = api.sandbox.push.apple.com
apns-id = eabeae54-14a8-11e5-b60b-1697f925ec7b
apns-push-type = alert
apns-expiration = 0
apns-priority = 10
DATA
+ END_STREAM
{ "aps" : { "alert" : "Hello" } }
Translated above into postman
I've a curl command in case it helps (it's in http2 though). Reference
Note: You MUST have curl 7.47+ with http/2 support compiled in
curl -v \
-d '{"aps":{"alert":"<message>","badge":42}}' \
-H "apns-topic: <bundle id>" \
-H "apns-priority: 10" \
--http2 \
--cert <certificate file> \
https://api.development.push.apple.com/3/device/<device token>
I have created multiple apps in predictionio.
While inserting events in predictionio, there a parameter accessKey (associated to app) which is passed.
Whereas for queries.json, couldn't find the accessKey parameter.
Sample below:
curl -H "Content-Type: application/json" \
-d '{ "items": ["i1", "i3"], "num": 10, "categories" : ["c4", "c3"], "blackList": ["i21", "i26", "i40"] }' \
http://localhost:8000/queries.json
{"itemScores":[{"item":"i39","score":1.0773502691896257},{"item":"i44","score":1.0773502691896257},{"item":"i14","score":1.0773502691896257},{"item":"i45","score":0.7886751345948129},{"item":"i47","score":0.7618016810571367},{"item":"i6","score":0.7618016810571367},{"item":"i28","score":0.7618016810571367},{"item":"i9","score":0.7618016810571367},{"item":"i29","score":0.6220084679281463},{"item":"i30","score":0.5386751345948129}]}
Now, how to query data for a particular app?