Notifications IOS apns - ios

I have completed my testing and all notifications are going through nicely using php apns. Now as soon as I switch to production I get this result
Tue, 16 Oct 2012 16:40:48 +0200 ApnsPHP[5709]: INFO: Trying ssl://gateway.push.apple.com:2195...
Tue, 16 Oct 2012 16:40:51 +0200 ApnsPHP[5709]: INFO: Connected to ssl://gateway.push.apple.com:2195.
Tue, 16 Oct 2012 16:40:51 +0200 ApnsPHP[5709]: INFO: Sending messages queue, run #1: 1 message(s) left in queue.
Tue, 16 Oct 2012 16:40:51 +0200 ApnsPHP[5709]: STATUS: Sending message ID 1 [custom identifier: Message-Badge-3] (1/3): 119 bytes.
Tue, 16 Oct 2012 16:40:51 +0200 ApnsPHP[5709]: INFO: Disconnected.
This looks fine to me however my device does not receive the notification.
Please Help

Ensure your DeviceToken is the production one. DeviceTokens for dev are different then production for the same device.
From Apple:
Take note that the device token in the production environment and the device token in the development environment are not the same value.
Source

Related

Lighthouse in GitLab CI

I'm trying to use Lighthouse in GitLab CI to run a scan against a remote website after a deploy. The job keeps throwing an error.
My job configuration looks like this:
lighthouse:
stage: scan
image: markhobson/node-chrome
script:
- npm install -g lighthouse lighthouse-plugin-field-performance --unsafe-perm
- lighthouse $URL --plugins=lighthouse-plugin-field-performance --chrome-flags=”--headless --no-sandbox” --verbose
I've also tried with image: buildkite/puppeteer. In both instances I get a similar error when I try to invoke Lighthouse, which looks like this:
Wed, 09 Oct 2019 20:22:42 GMT ChromeLauncher:verbose created /tmp/lighthouse.KXhqWF0
Wed, 09 Oct 2019 20:22:42 GMT ChromeLauncher:verbose Launching with command:
"/usr/bin/google-chrome-stable" --disable-translate --disable-extensions --disable-background-networking --disable-sync --metrics-recording-only --disable-default-apps --mute-audio --no-first-run --remote-debugging-port=44495 --disable-setuid-sandbox --user-data-dir=/tmp/lighthouse.KXhqWF0 about:blank
Wed, 09 Oct 2019 20:22:42 GMT ChromeLauncher:verbose Chrome running with pid 36 on port 44495.
Wed, 09 Oct 2019 20:22:42 GMT ChromeLauncher Waiting for browser.
Wed, 09 Oct 2019 20:22:42 GMT ChromeLauncher Waiting for browser...
Wed, 09 Oct 2019 20:22:43 GMT ChromeLauncher Waiting for browser.....
Wed, 09 Oct 2019 20:22:43 GMT ChromeLauncher Waiting for browser.......
Wed, 09 Oct 2019 20:22:44 GMT ChromeLauncher Waiting for browser.........
Wed, 09 Oct 2019 20:22:44 GMT ChromeLauncher Waiting for browser...........
etc
Wed, 09 Oct 2019 20:23:07 GMT ChromeLauncher:error connect ECONNREFUSED 127.0.0.1:44495
Wed, 09 Oct 2019 20:23:07 GMT ChromeLauncher:error Logging contents of /tmp/lighthouse.KXhqWF0/chrome-err.log
Wed, 09 Oct 2019 20:23:07 GMT ChromeLauncher:error
(google-chrome-stable:36): Gtk-WARNING **: cannot open display:
[1009/202244.656645:ERROR:nacl_helper_linux.cc(310)] NaCl helper process running without a sandbox!
Most likely you need to configure your SUID sandbox correctly
Unable to connect to Chrome
I'm not entirely sure what I need to do at this point. I'm questioning whether or not to try a more basic node image and try installing what I need manually, which I tried originally and found that managing Chrome/Chromium with Lighthouse was not quite as straight-forward as I wanted. Any thoughts or suggestions?
You could try using this image which has both everything installed ready to execute a report https://hub.docker.com/r/femtopixel/google-lighthouse/

App error on iOS simulator

I was debugging my application earlier today from Visual Studio Cordova to iOS simulator running on a mac just fine.
After minimal changes, it would no longer run and seemed to crash instantly, giving the following errors in the system log:
Feb 22 14:59:28 Derricks-Air com.apple.CoreSimulator.SimDevice.FD118263-FDD1-4B7F-ADDB-0B5BA5811F88.launchd_sim[1946] (UIKitApplication:com.packagename.mail[0x8540][2832]): Program specified by service does not contain one of the requested architectures: ï
Feb 22 14:59:28 Derricks-Air SpringBoard[1962]: Unable to get pid for 'UIKitApplication:com.packagename.mail[0x8540]': No such process (err 3)
Feb 22 14:59:28 Derricks-Air SpringBoard[1962]: Bootstrapping failed for <FBApplicationProcess: 0x7d890cd0; com.packagename.mail; pid: -1>
Feb 22 14:59:28 Derricks-Air SpringBoard[1962]: Application 'UIKitApplication:com.packagename.mail[0x8540]' exited voluntarily.
I have since reverted any code changes and am still having this issue.
Any ideas?

What do these Xcode simulator system errors mean?

The Xcode simulator disconnects from Xcode which will no longer show information in the console of Xcode. Xcode then provided the following error: "DTAssetProviderService could not start DTXConnection with Simulator 'iPhone 6'. Check the system log for errors."
I've tried quitting and restarting both the simulator and Xcode but still no luck. Here are the system log errors:
Jun 25 15:49:34 --- last message repeated 1 time ---
Jun 25 15:49:34 Laurences-MBP diagnosticd[8123]: System mode client started - Console (8117) - mode: 0x8
Jun 25 15:49:48 Laurences-MBP sandboxd[10550] ([318]): useractivityd(318) deny mach-lookup com.apple.PowerManagement.control
Jun 25 15:49:53 --- last message repeated 1 time ---
Jun 25 15:49:53 Laurences-MBP cloudd[10528]: notify name "com.apple.cloudkit.pcs.flushCaches" has been registered 20 times - this may be a leak
Jun 25 15:50:05 Laurences-MBP sandboxd[10550] ([318]): useractivityd(318) deny mach-lookup com.apple.PowerManagement.control
Jun 25 15:50:05 Laurences-MBP syslogd[47]: ASL Sender Statistics
Jun 25 15:50:08 Laurences-MBP sandboxd[10550] ([318]): useractivityd(318) deny mach-lookup com.apple.PowerManagement.control
Jun 25 15:50:11 Laurences-MBP diagnosticd[8123]: System mode client started - Console (8117) - mode: 0x8
Jun 25 15:50:44 Laurences-MBP sandboxd[10550] ([10647]): lsd(10647) System Policy: deny system-privilege 1013
Jun 25 15:51:00 --- last message repeated 1 time ---
Jun 25 15:51:00 Laurences-MBP DTServiceHub[10677]: DTServiceHub[10677]: [error] 'mach_msg_send' failed: (ipc/send) invalid destination port (268435459)
Jun 25 15:51:09 Laurences-MBP Xcode[7692]: Xcode[7692]: [error] 'mach_msg_send' failed: (ipc/send) invalid destination port (268435459)
Jun 25 15:51:09 Laurences-MBP Xcode[7692]: +[DTServiceHubClient localConnectionWithAuthorization:returningServerPid:]: failed to establish connection with DTServiceHub service '/Applications/Xcode.app/Contents/SharedFrameworks/DVTInstrumentsFoundation.framework/Resources/DTServiceHub'
Jun 25 15:51:09 Laurences-MBP Xcode[7692]: Xcode[7692]: [error] 'mach_msg_send' failed: (ipc/send) invalid destination port (268435459)
You're using Xcode 7.3.1 on macOS Sierra Beta which is not supported. This question has been discussed in more detail in XCode "DTAssetProviderService could not start.." error, How fix this?
Use Xcode 8 beta or Xcode 7.3.1 the .dmg image downloaded from the Developer Portal https://developer.apple.com/download/more/ which doesn't exhibit this problem like the Mac App Store version.

NodeMCU traceback on reboot

I have an embedded application running NodeMCU that is not connected to a console as the UART has been repurposed to obtain serial data from an attached device.
During testing the application ran for about 15 hours then rebooted 5 times in a row before "settling" and continuing to run correctly.
Is it possible to log to a file a traceback of what caused the reboots? I am assuming some kind of PANIC error caused the reboot. I don't think it is a memory issue as the application reports the heap size (via http to a local server) every 30 seconds. Here is a log extract:
Wed May 18 00:46:37 2016 -> '{"s":"1782","i":"1afe34d26348", "d":"heap=12408
Wed May 18 00:47:08 2016 -> '{"s":"1783","i":"1afe34d26348", "d":"heap=12408
Wed May 18 00:47:39 2016 -> '{"s":"1784","i":"1afe34d26348", "d":"heap=12408
Wed May 18 00:48:19 2016 -> '{"s":"1785","i":"1afe34d26348", "d":"heap=11432
Wed May 18 00:50:06 2016 -> '{"s":"0","i":"1afe34d26348", "d":"heap=14560
Wed May 18 00:51:25 2016 -> '{"s":"0","i":"1afe34d26348", "d":"heap=14584
Wed May 18 00:52:45 2016 -> '{"s":"0","i":"1afe34d26348", "d":"heap=14560
Wed May 18 00:54:04 2016 -> '{"s":"0","i":"1afe34d26348", "d":"heap=14584
Wed May 18 00:55:24 2016 -> '{"s":"0","i":"1afe34d26348", "d":"heap=14608
Wed May 18 00:55:55 2016 -> '{"s":"1","i":"1afe34d26348", "d":"heap=12608
Wed May 18 00:56:26 2016 -> '{"s":"2","i":"1afe34d26348", "d":"heap=12600
Wed May 18 00:56:56 2016 -> '{"s":"3","i":"1afe34d26348", "d":"heap=12624
Wed May 18 00:57:27 2016 -> '{"s":"4","i":"1afe34d26348", "d":"heap=12600
I the above log "s" is a sequential counter that is reset to 0 when the device reboots, and "d" is the heap size (you can ignore the "i" entry, it is just the MAC address of the device that is sending the data).
xpcall won't work in the case of a PANIC device reset.
I tried logging node.bootreason() to a file on reboot, but it doesn't contain a traceback to where the error occurred.
Is there some method for troubleshooting nodemcu applications that aren't connected to a console?

Worklight WL.Client.Push.onReadyToSubscribe not getting fired

I am facing an issue with Worklight Push Notification.
I followed all steps of Worklight 5.0.5, Module_41_-_Push_Notifications.
PDF file, and did Push demo.
I am facing an error stating:
[ERROR] Can't subscribe, notification token is not updated on the
server
Although on the console it does show the device ID.
My assumption is WL.Client.Push.onReadyToSubscribe not getting fired.
Someone had similar issues.
https://www.ibm.com/developerworks/forums/thread.jspa?threadID=456501
I have set
<pushSender password="Your_Password"/>
and re-generated and deployed App multiple times but no benefit.
Any help or suggestion are welcome.
Environment:
WL 5.0.5 & 5.0.6
Xcode 4.2
iPhone (iOS 5.1 and 6.1)
I tried once again on local mac, testing via iPhone 4 , iOS 5.1. when running through device and connecting to Studio jetty. I am getting below.
Mar 27 11:23:49 Appsdev-iPhone PushApplication[211] <Warning>: Applications are expected to have a root view controller at the end of application launch
Mar 27 11:23:49 Appsdev-iPhone PushApplication[211] <Warning>: Web resources integrity test is disabled.
Mar 27 11:23:49 Appsdev-iPhone kernel[0] <Debug>: launchd[211] Builtin profile: container (sandbox)
Mar 27 11:23:49 Appsdev-iPhone kernel[0] <Debug>: launchd[211] Container: /private/var/mobile/Applications/5DA837C4-F039-4795-9509-C98383E40C68 [69] (sandbox)
Mar 27 11:23:49 Appsdev-iPhone PushApplication[211] <Warning>: Multi-tasking -> Device: YES, App: YES
Mar 27 11:23:51 Appsdev-iPhone PushApplication[211] <Warning>: [LOG] ondeviceready event dispatched
Mar 27 11:23:51 Appsdev-iPhone PushApplication[211] <Warning>: {
appVersionPref = "1.0";
freeSpace = 14291787776;
wlSkinLoaderChecksum = "(null)";
wlSkinName = default;
}
Mar 27 11:23:51 Appsdev-iPhone PushApplication[211] <Warning>: [LOG] wlclient init started
Mar 27 11:23:51 Appsdev-iPhone PushApplication[211] <Warning>: [LOG] Read cookies: null
Mar 27 11:23:51 Appsdev-iPhone PushApplication[211] <Warning>: [LOG] CookieMgr read cookies: {}
Mar 27 11:23:51 Appsdev-iPhone PushApplication[211] <Warning>: [LOG] Request [http://172.20.10.2:8080/apps/services/api/PushApplication/iphone/init]
Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] <Warning>: [LOG] Request [login]
Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] <Warning>: [LOG] Request [http://172.20.10.2:8080/apps/services/api/PushApplication/iphone/init]
Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] <Warning>: DeviceAuthManager:getWorklightUniqueDeviceId --> returning UUID from the keychain
Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] <Warning>: [LOG] Request [http://172.20.10.2:8080/apps/services/api/PushApplication/iphone/init]
Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] <Warning>: [LOG] Clearing notification subscriptions.
Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] <Warning>: [LOG] Send new server notification token id.
Mar 27 11:24:12 Appsdev-iPhone SpringBoard[15] <Warning>: No valid 'aps-environment' entitlement string found for application 'PushApplication': (null). Notifications will not be delivered.
Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] <Warning>: [LOG] response [http://172.20.10.2:8080/apps/services/api/PushApplication/iphone/init] success: /*-secure-
{"userPrefs":{},"WL-Authentication-Success":{"wl_remoteDisableRealm":{"userId":"null","attributes":{},"isUserAuthenticated":1,"displayName":"null"},"PushAppRealm":{"userId":"aahad","attributes":{},"isUserAuthenticated":1,"displayName":"aahad"},"wl_antiXSRFRealm":{"userId":"3l6ap8g9t4h9uk5rb1fmqfok15","attributes":{},"isUserAuthenticated":1,"displayName":"3l6ap8g9t4h9uk5rb1fmqfok15"},"wl_deviceNoProvisioningRealm":{"userId":"57B167E4-1258-4AD7-9DA1-92DC66A0451E","attributes":{"mobileClientData":"com.worklight.core.auth.impl.MobileClientData#6a76de98"},"isUserAuthenticated":1,"displayName":"57B167E4-1258-4AD7-9DA1-92DC66A0451E"}},"notificationSubscriptionState":{},"gadgetProps":{"directUpdate":{"updateUnpackedSize":1014255,"availableSkins":["default"],"checksum":4077143359,"updateSize":290080},"ENVIRONMENT":"iphone"},"userInfo":{"wl_authenticityRealm":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null},"SampleAppRealm":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null},"wl_remoteDisableRealm":{"userId":"null","attributes":{},"isUserAuthenticated":1,"displayName":"null"},"PushAppRealm":{"userId":"aahad","attributes":{},"isUserAuthenticated":1,"displayName":"aahad"},"wl_antiXSRFRealm":{"userId":"3l6ap8g9t4h9uk5rb1fmqfok15","attributes":{},"isUserAuthenticated":1,"displayName":"3l6ap8g9t4h9uk5rb1fmqfok15"},"WorklightConsole":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null},"wl_deviceAutoProvisioningRealm":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null},"wl_deviceNoProvisioningRealm":{"userId":"57B167E4-1258-4AD7-9DA1-92DC66A0451E","attributes":{"mobileClientData":"com.worklight.core.auth.impl.MobileClientData#6a76de98"},"isUserAuthenticated":1,"displayName":"57B167E4-1258-4AD7-9DA1-92DC66A0451E"},"myserver":{"userId":"aahad","attributes":{},"isUserAuthenticated":1,"displayName":"aahad"},"wl_anonymousUserRealm":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null}}}*/
Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] <Warning>: [LOG] wlclient connect success
Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] <Warning>: [LOG] before: app init onSuccess
Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] <Warning>: [LOG] after: app init onSuccess
Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] <Warning>: [LOG] wlclient init success
Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] <Warning>: Could not register for remote notifications: Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for application" UserInfo=0xfeafba0 {NSLocalizedDescription=no valid 'aps-environment' entitlement string found for application}
Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] <Warning>: [ERROR] Error while trying to retrieve device token from the mobile operating system.
see attached snapshots.
The steps to generate APNS:
Logged on to Apple Account select App ID ->Configure -> Enable Push
Selected Development Push SSL Certificate
Generated a new CSR first and then got a Certificate
Double clicked the certificate and from Keychain selected this new Certificate and its Private key, and then right-click and Export and saved as
apns-certificate-sandbox.p12
copied into Worklight, on the root of App folder at the same level of application-descriptor.xml
provided pushSender password and given securityTest
Thanks
#Idan,
Its resolved now. There were two reasons:
After copying APNS certificate inside the worklight App folder, you have to re-generate & deploy all. You must then deploy wlapp on WL consle....... that is was NOT doing.
I used a wrong custom security realm for iPhone environment that blocked the WL Server to response back to device.
Hope this info will help others facing similar issues.
Thanks
Make sure that you have:
Added the iPhone environment to application-descriptor.xml (using the Worklight-provided wizard)
Added the mobile securityTest to the iphone environment (see how it is done for the Android environment; copy it)
Placed the .p12 certificate in the application folder (same level as the environment folders)
That the name of the certificate is "apns-certificate-sandbox.p12" (for development) or "apns-certificate-production.p12" (for production)
Added the correct password in the pushSender element
After logging-in in the application, you should get an alert stating that you are able to subscribe.
To make sure you have properly setup your development environment, follow this guide: Understanding and setting up artifacts required to use iOS devices and Apple Push Notifications services (APNS) in development environment

Resources