I wanted to create an ane file using UrbanAirship latest sdk. I have added Autopilot metadata(<meta-data android:name="com.urbanairship.autopilot" android:value="com.sample.aneAndroid.TakeOffHelper" /> )
in my app-xml under the application block and also created a subclass of Autopilot and added AirshipConfigOptions there. When I try to call Autopilot.automaticTakeOff(app);
in the class which implement FREFunction it gives below error-
02-03 17:14:11.949 23088-23088/? I/dalvikvm﹕ Could not find method com.urbanairship.Autopilot.automaticTakeOff, referenced from method com.sample.aneAndroid.UAPushNotificationExtensionSubscribeFunction.call
02-03 17:14:11.949 23088-23088/? W/dalvikvm﹕ VFY: unable to resolve static method 3322: Lcom/urbanairship/Autopilot;.automaticTakeOff (Landroid/app/Application;)V
TakeOffHelper.java
@Override
public AirshipConfigOptions createAirshipConfigOptions(Context context) {
Log.v("Autopilot", "createAirshipConfigOptions called");
AirshipConfigOptions options = AirshipConfigOptions.loadDefaultOptions(context.getApplicationContext());
Log.v("Autopilot", "createAirshipConfigOptions called " + options);
return options;
}
@Override
public void onAirshipReady(UAirship airship) {
Log.v("Autopilot", "onAirshipReady called");
DefaultNotificationFactory defaultNotificationFactory = new DefaultNotificationFactory(UAirship.getApplicationContext());
defaultNotificationFactory.setColor(NotificationCompat.COLOR_DEFAULT);
// Set it
airship.getPushManager().setNotificationFactory(defaultNotificationFactory);
// Enable Push
airship.getPushManager().setPushEnabled(true);
}
UAPushNotificationExtensionInitFunction.java
public FREObject call(FREContext context, FREObject[] args) {
UAPushNotificationExtensionContext nec = (UAPushNotificationExtensionContext) context;
android.app.Activity activity = nec.getActivity();
nec.activity = activity;
Application app = context.getActivity().getApplication();
Autopilot.automaticTakeOff(app);}