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 CodeDescriptionNotes
800SDK initialization success 
801SDK initializing in progress 
802Initializing pressure providerThe test mobile phone may not include a barometric sensor
803Initializing location provider 
804No location availableConsider as initialization failed after 10 seconds
805No pressure availableConsider as initialization failed after 10 seconds
806SDK initialization failed 
808SDK is already initialized 
810SDK is not initialized 
811SDK stop successfully 
815Input host URL is invalid 
830Altitude mode is activated 
832Waiting for pressure for assistance fetch 
833Waiting for location for assistance fetch 
835Altitude mode is deactivated 
870Manual barometer calibration success 
871Manual barometer calibration in progress 
872Manual barometer calibration failedThe end-user may be directed to manually calibrate in a different place/location and at a different time
876Device pressure reading is changing too fast and/or user doesn’t seem to be stillThe 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.
877Not a good place (Ex: outside coverage area etc.) to collect dataThe end-user may be directed to manually calibrate in a different place/location and at a different time
896Activity permission is needed 
878Motion permission is needed 
898Location permission is needed 
899Storage permission is needed 
403Invalid 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.