Understanding the Plugin
There is a very specific sequence of steps that are needed in order to properly Initialize, Calibrate and Receive Altitude Data.
IMPORTANT REMINDER: due to the reliance of the plugin on the device’s HW capabilities, it’s not possible to utilize the Plugin in the editor.
The steps below must be performed in sequence for the Plugin to work properly:
- Call Init method (SDKManager class) and wait until you receive Status Code 800 (SDK Initialization Success), you can do this by calling GetSDKStatus at any time after the sdk it’s initialized.
- Launch the calibration screens by calling ShowCalibrationUI. You should see the following screen:In order for Calibration and Altitude to work, the SDK needs to be able to display a Map and be updated with Latitude and Longitude values.
- Follow the instructions and wait until you receive Status Code 870 (Manual Baro Calibration Success). If calibration fails, you can troubleshoot using the table below.
- Invoke any of the StartAltitudeCalculation methods (there are three alternatives that obtain Altitude at different frequencies: 1, 30 or 60 seconds, as well as one single time).
Troubleshoot any other Status Codes with the following reference table:
Error Code | Description | Notes |
800 | SDK initialization success | |
801 | SDK initializing in progress | |
802 | Initializing pressure provider | The test mobile phone may not include a barometric sensor |
803 | Initializing location provider | |
804 | No location available | Consider as initialization failed after 10 seconds |
805 | No pressure available | Consider as initialization failed after 10 seconds |
806 | SDK initialization failed | |
808 | SDK is already initialized | |
810 | SDK is not initialized | |
811 | SDK stop successfully | |
815 | Input host URL is invalid | |
830 | Altitude mode is activated | |
832 | Waiting for pressure for assistance fetch | |
833 | Waiting for location for assistance fetch | |
835 | Altitude mode is deactivated | |
870 | Manual barometer calibration success | |
871 | Manual barometer calibration in progress | |
872 | Manual barometer calibration failed | The end-user may be directed to manually calibrate in a different place/location and at a different time |
876 | Device pressure reading is changing too fast and/or user doesn’t seem to be still | The Pinnacle SDK cannot run the manual-calibration operation due to rapid movement/change. The end user may be directed that a calibration is needed when the user’s device is not moving. |
877 | Not a good place (Ex: outside coverage area etc.) to collect data | The end-user may be directed to manually calibrate in a different place/location and at a different time |
896 | Activity permission is needed | |
878 | Motion permission is needed | |
898 | Location permission is needed | |
899 | Storage permission is needed | |
403 | Invalid API Key |
IMPORTANT: on Android, if you receive Status Code 896, some permissions have not been granted successfully. This can happen depending on your project’s configuration and also AndroidManifest’s merge issues. If that’s the case, simply press the P button located on the top right corner of the screen to force the Permissions dialog to appear.