public override void OnCreate() { var options = AirshipConfigOptions.LoadDefaultOptions(this); // Optionally, customize your config options.InProduction = false; options.DevelopmentAppKey = ""; options.DevelopmentAppSecret = ""; UAirship.TakeOff(this, options); //use CustomPushNotificationBuilder to specify a custom layout CustomPushNotificationBuilder nb = new CustomPushNotificationBuilder(); nb.StatusBarIconDrawableId = Resource.Id.icon; //custom status bar icon nb.Layout = Resource.Layout.notification; nb.LayoutIconDrawableId = Resource.Id.icon; //custom layout icon nb.LayoutIconId = Resource.Id.icon; nb.LayoutSubjectId = Resource.Id.subject; nb.LayoutMessageId = Resource.Id.message; PushManager.Shared().NotificationBuilder = nb; PushManager.Shared().IntentReceiver = Class.FromType(typeof(IntentReceiver)); UALocationManager.Shared().IntentReceiver = Class.FromType(typeof(IntentReceiver)); }
public override void OnCreate() { UAirship.TakeOff(this); PushManager.Shared().IntentReceiver = Class.FromType(typeof(PushReceiver)); RichPushManager.SetJavascriptInterface(Class.FromType(typeof(RichPushMessageJavaScript)), "urbanairship"); // If running on Jelly Bean or higher, then use the inbox style notification builder if ((int)Build.VERSION.SdkInt >= (int)BuildVersionCodes.JellyBean) { PushManager.Shared().NotificationBuilder = new RichNotificationBuilder(); } }
private void SetAlias(string alias) { alias = UAStringUtil.IsEmpty(alias) ? null : alias; PushManager.Shared().Alias = (alias); if (UAirship.Shared().AirshipConfigOptions.RichPushEnabled) { RichPushManager.Shared().RichPushUser.Alias = (alias); RichPushManager.Shared().UpdateUser(); } currentAlias = alias; }
private void UpdateApidField() { String apidString = PushManager.Shared().APID; if (!PushManager.Shared().Preferences.IsPushEnabled || apidString == null) { apidString = ""; } // fill in apid text EditText apidTextField = (EditText)FindViewById(Resource.Id.apidText); if (!apidString.Equals(apidTextField.Text)) { apidTextField.Text = (apidString); } }
private void SetTags(IList <String> tags) { currentTags.Clear(); foreach (var tag in tags) { currentTags.Add(tag); } PushManager.Shared().Tags = currentTags; if (UAirship.Shared().AirshipConfigOptions.RichPushEnabled) { // FIXME: not sure if this use of ToArray() is safe... RichPushManager.Shared().RichPushUser.Tags = new Java.Util.HashSet(currentTags.ToArray()); RichPushManager.Shared().UpdateUser(); } }
public AddTagsPreference(Context context, IAttributeSet attrs) : base(context, attrs) { currentTags = PushManager.Shared().Tags; }
public SetAliasPreference(Context context, IAttributeSet attrs) : base(context, attrs) { currentAlias = PushManager.Shared().Preferences.Alias; }