private static void airshipTakeOff() { Log.i(LCAT, "Airship taking off"); try { AirshipConfigOptions options = AirshipConfigOptions.loadDefaultOptions(TiApplication.getInstance()); // NOTE: In-App Purchasing is not currently supported in this module // Remove this next statement once we implement iap options.iapEnabled = false; // Attempt takeoff UAirship.takeOff(TiApplication.getInstance(), options); // Airship has successfully taken off. Set up the notification handler PushManager.shared().setIntentReceiver(IntentReceiver.class); } catch (Exception e) { Log.e(LCAT, "Error occurred during takeoff!!!"); } }
@Override public void onCreate() { super.onCreate(); appInstance = this; mRequestQueue = Volley.newRequestQueue(this); setupLiveLabsApi(); FacebookSdk.sdkInitialize(getApplicationContext()); DataHelper.init(getApplicationContext()); AirshipConfigOptions options = AirshipConfigOptions.loadDefaultOptions(this); options.inProduction = !BuildConfig.DEBUG; UAirship.takeOff(this, options); PushManager.enablePush(); PushManager.shared().setIntentReceiver(IntentReceiver.class); PushPreferences prefs = PushManager.shared().getPreferences(); Log.i("TAG", " testing My Application onCreate - App APID: " + prefs.getPushId()); Logger.info("My Application onCreate - App APID: " + prefs.getPushId()); Log.d(" testing", " testing My Application onCreate - App APID: " + prefs.getPushId()); myridTypeFace = Typeface.createFromAsset(getAssets(), "MyriadPro-Semibold.otf"); ImageCacheParams cacheParams = new ImageCacheParams(IMAGE_CACHE_DIR); // PhucVM: we need to cast this to LONG because the value can be greater than int maximum => it // will be less than 0 if we use int long tempMemory = 1024 * 1024 * (long) (ImageLoaderUtils.getMemoryClass(this.getApplicationContext())) * 8; cacheParams.memCacheSize = (int) (tempMemory / 19); mImageCache = new ImageCache(this, cacheParams); mImageFetcher = new ImageFetcher(this); mImageFetcher.setImageCache(mImageCache); try { application_version = getPackageManager().getPackageInfo(getPackageName(), 0).versionName; } catch (NameNotFoundException e) { application_version = UNDEFINED_VERSION; } }
@Override public void onCreate() { // Load options AirshipConfigOptions options = AirshipConfigOptions.loadDefaultOptions(this); // Set options to enable push notifications options.transport = "helium"; options.developmentAppKey = "_7UGKHwnQ2eKFLNNy_pgxw"; options.developmentAppSecret = "C5n_fo9fQXixZWPVCGJqRg"; options.productionAppKey = "5wioYYXrS3eykPlh-dxwPg"; options.productionAppSecret = "C2czYq-wQIqUpQKuQF8i-A"; options.inProduction = true; // Up up and away UAirship.takeOff(this, options); // Enable push PushManager.enablePush(); // Get APID PushPreferences prefs = PushManager.shared().getPreferences(); Logger.info("My Application onCreate - App APID: " + prefs.getPushId()); }