Troubleshooting SNAPmobile App issues
Table of Contents
Scope
Intended Audience: Tier 3 Techniciansor higher
This document serves as a guideline on how to troubleshoot Unbranded/Branded SNAPMobile App. A summary of how SNAPmobile push works, looking at api_config.php for configuration, Inspecting the log for push response from APN or Firebase, Looking at the call trace and identifying if the push was send and if the device is able to register and finally, escalating the case to the senior tech.
Requirements
- SSH Access on Core Servers
- Google and iOS Developer Account
- Carriers Portal ( BW, Brightlink, etc.. ) using SMS/MMS Feature
SNAPmobile App Summary
As of writing this KB, the latest release of the SNAPmobile App for Android and iOS is version 3.1. SNAPMobile uses the NS API, WebSockets, and Firebase and Appl APN Push services. The methodology is that when a SNAPMobile App is not working that it could be related to one of these services, or api_config.php configuration issue. NS API is what the app use to verify the user logging into the app and all other features such as contacts, call history, device registration, SMS/MMS, etc... Push Services plays a big part in SNAPMobile as this is the way to tell the app when to wake up such as incoming calls, and SMS/MMS notification.
Troubleshooting PUSH Notification
When troubleshooting push notifications, you need to identify if the issue is for iOS or Android Devices. Once you have identified the vendor, you then need to narrow it down to branded or unbranded. Furthermore, determine if the issue is affecting just a number of devices or all devices.
- SSH into the primary core.
- Then we need to enable debugging on that core. Let's open the api_config.php and set nsdebug to 2.
sudo vi /etc/netsapiens/api_config.php
-
Note: To save the changes and close in vim, press
esc
type:
then followed bywq
and hit enter to save and close. To quit vi and disregard, pressesc
type:
thenqa!
- Now that debugging is enabled, let's run a tail command to watch the output of debug.log log, we are looking for push logs.
tail -f /usr/local/NetSapiens/netsapiens-api/tmp/logs/debuglog | grep push -C5
- or
tail -f /usr/local/NetSapiens/netsapiens-api/tmp/logs/debug.log | grep -i -B10 -A50 push
- The output above would show something similar to the one below when NMS sends the push to firebase service
Notice that the first result is the device info, the second one is where the push url, third is the actual attempt to push it to the push service, then the last one is the response error. This one shows 401, which is basically invalid credentials or could be expired cert. - Furthermore, the debug may contain a brief on what the issue maybe. Below is an example error you should watch out for as per NS.
- As for Apple Push, you will see Unable to connect message when the push is sent to APN Network. Look out for that response in the debug.log. If you don't see this and you saw success, then get an app.log from the device.
- You may also need to verify the api keys in api_config.php. Sometimes push notifications may not work because the api keys are either expired on invalid.
Open api config in vim or nanovi /etc/netsapiens/api_config.php
ornano /etc/netsapiens/api_config.php
- Make sure that APNS.custom_certs is set to true
- For unbranded Android Snapmobile, verify that the FIREBASE.SNAPmobile.api_key exists
- For branded Android SNAPmobile, verify that FIREBASE.<AppName>.api_key exists where <AppName> could be the company name.
FYI, Above key example is truncated - For unbranded iOS Snapmobile, verify that the APNS.SNAPmobile.cert and APNS.SNAPmobile.passphrase exists
Note that the expiration of the cert is also noted above the cert line. Ensure apns_cert.pem exists in the path above - For Branded iOS SNAPmobile, verify the following exists for each WLP branded app.
Ensure that the .pem file exists for each branded app in the path specified - Apple APN push notification service must be configured using token-based config introduced in SNAPmobile 3.0. You can follow this doc https://documentation.netsapiens.com/154025-snapmobile/854766-how-to-configure-http-2-apns-token-based-push-configuration-for-v41-2-2?from_search=77254181
- Firebase Android push notification service, you can still refer to this https://help.netsapiens.com/hc/en-us/articles/360035370034-How-Do-I-Configure-PUSH-for-SNAPmobile-Android-
- For iOS Unbranded SNAPMobile token-based config, make sure the following exists. Ensure the .p8 file exists in the specified path
- For iOS Branded SNAPmobile token-based config, make sure the following exists for each WLP branded app config. Ensure the .p8 file exists in the specified path
- Furthermore, when you're troubleshooting push, make sure that the device you're troubleshooting is push enabled in NMS. Go to NMS -> Connection -> User Devices. Locate the device that's associated to the the SNAPmobile app user which is normally <ext>m for iPhones or <ext>t for tablet ( don't confuse the t with Team extension)
- You may also look for publish keyword in the call trace. If you see that PublishPush, then this means we pushed the notification and we should be receiving a registration from the user. Check in NMS -> Connection -> User Devices the last registration time if it matches the time NMS published the push.
- While you're inspecting the call trace, you can determine if the push was received by the SNAPMobile App, and if the device was able to register back to the NMS.
So as per above, we try and locate the PublishPush to make sure that it is being pushed, then search for registration and notice above that it says just got registration. This means that we were able to successfully push the notification to the device from NMS -> Push Services-> SNAPMobile App and the SNAPmobile app was able to register to NMS successfully. - If troubleshooting is unsuccessful, escalate to NS