Hello,

Anyone having any luck sending notifications to Apple's Push Notification 
Servers?

I'm getting mixed results when I try to POST the HTTP REQUEST:
in v16.4: 
Error code: 49
SSL internal error : error:14094418:SSL routines:ssl3_read_bytes:tlsv1 alert 
unknown ca
component: 'srvr'
in v17.0:
Error code: 17 (4DRT)
Unimplemented control instruction.

I know I've set up my token/etc correctly as I can send test push notifications 
with another app, but I don't think I'm getting that far (to even authenticate 
with apple) based on these errors.

Code snippet:
url_sandbox:="https://"+"api.sandbox.push.apple.com:443 
<http://api.sandbox.push.apple.com:443/>"
url_production:="https://"+"api.push.apple.com:443 
<http://api.push.apple.com:443/>"

device_token:="675d6ce5" // not my real device token
auth_token:="MIGTAgEAMBMGByq" // not my real token

apn_path:="/3/device/"+device_token
apn_authorization:="bearer "+auth_token
apns_id:=GenerateUUID_Canonical 
apns_expiration:=0  // 0=send once
apns_priority:=10
apns_topic:="com.buckler_obfuscated_bundleid.appname"
contents:="{ \"aps\" : { \"alert\" : \"Hello\" } }"
response:=""

C_OBJECT(vO_response)
ARRAY TEXT($headerNames_at;0)
ARRAY TEXT($headerValues_at;0)
APPEND TO ARRAY($headerNames_at;"Content-Type")
APPEND TO ARRAY($headerValues_at;"application/x-www-form-urlencoded")
APPEND TO ARRAY($headerNames_at;"Content-Length")
APPEND TO ARRAY($headerValues_at;String(Length(contents)))

  //APPEND TO ARRAY($headerNames_at;":path")
  //APPEND TO ARRAY($headerValues_at;apn_path)

APPEND TO ARRAY($headerNames_at;"authorization")
APPEND TO ARRAY($headerValues_at;apn_authorization)

APPEND TO ARRAY($headerNames_at;"apns-id")
APPEND TO ARRAY($headerValues_at;apns_id)

APPEND TO ARRAY($headerNames_at;"apns-expiration")
APPEND TO ARRAY($headerValues_at;String(apns_expiration))

APPEND TO ARRAY($headerNames_at;"apns-priority")
APPEND TO ARRAY($headerValues_at;String(apns_priority))

APPEND TO ARRAY($headerNames_at;"apns-topic")
APPEND TO ARRAY($headerValues_at;apns_topic)

full_url:=url_sandbox+apn_path

result:=HTTP Request(HTTP POST 
method;full_url;contents;response;$headerNames_at;$headerValues_at)
**ERRORS HERE!!!

Insight Appreciated,

Tom

Tom Buckler | Buckler Microelectronics Inc.
17008 - 90 Avenue NW | Suite 272 | Edmonton | AB | Canada | T5T 1L6
Cell: (780) 499-5525 




**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to