One of the major requirements in our app is that the API key and secret be set during runtime.
There's an API (say sign up API) where our existing users sign up with their credentials. The sign-up API sends the users the UrbanAirship API key and secret in response only if the credentials are right and the account is active.
The API key and secret is set during runtime in a thread as follows:
options = new AirshipConfigOptions.Builder()
// Create Notification Factory
DefaultNotificationFactory defaultNotificationFactory = new DefaultNotificationFactory(getApplicationContext());
defaultNotificationFactory.setColor(Color.rgb(12, 128, 64));
// receive only one push
It works perfectly until the app is closed. Once the app is closed, although we send push notifications, nothing is received by the mobile app. When the app is killed or running in the background (it's GUI is not active) - no notifications are received.
Please let us know if there are any other configurations that need to be enabled to get this working.
Please note that we don't want to hardcode the API in airship config file, needs to happen at runtime.