/// <summary> /// Init. </summary> /// <param name="context"> application context. </param> private EngagementNativePushAgent(Context context) { /* Init */ mContext = context; mEngagementAgent = EngagementAgent.getInstance(context); mStorage = context.getSharedPreferences(STORAGE_FILE, 0); }
public override void DidReceiveRemoteNotification(UIApplication application, NSDictionary userInfo, Action <UIBackgroundFetchResult> completionHandler) { //バッジナンバーを消す application.ApplicationIconBadgeNumber = 0; //起動中にPush通知された場合に画面下部に通知を表示する処理 EngagementAgent.ApplicationDidReceiveRemoteNotification(userInfo, completionHandler); }
/// <summary> /// Send feedback to Reach. </summary> /// <param name="context"> application context. </param> /// <param name="status"> feedback status. </param> /// <param name="extras"> optional feedback payload (like poll answers). </param> public virtual void sendFeedBack(Context context, string status, Bundle extras) { /* Don't send feedback if test campaign */ if (mId[0] != '-') { EngagementAgent agent = EngagementAgent.getInstance(context); agent.sendReachFeedback(mKind.ShortName, mId, status, extras); } }
protected override void OnCreate(Bundle bundle) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(bundle); global::Xamarin.Forms.Forms.Init(this, bundle); LoadApplication(new App()); //Mobile Engagement の初期化 EngagementConfiguration engagementConfiguration = new EngagementConfiguration(); //ME接続先 engagementConfiguration.ConnectionString = connectionString; EngagementAgent.Init(engagementConfiguration); }
protected internal override void onCreate(Bundle savedInstanceState) { base.onCreate(savedInstanceState); mEngagementAgent = EngagementAgent.getInstance(this); /* FIXME temporary empty adapter to avoid side effects with Reach */ if (ExpandableListAdapter == null) { /* This will trigger required initialization */ ListAdapter = new BaseExpandableListAdapterAnonymousInnerClassHelper(this); /* * We can now safely reset the adapter to null to avoid side effect with * 3rd party code testing the null pointer. */ ListAdapter = null; } }
void Start() { Display("Engagement Sample"); EngagementAgent.Initialize(); EngagementReach.HandleURL += (string _push) => { Display("HandleURL " + _push); }; EngagementReach.StringDataPushReceived += (string _category, string _body) => { Display("StringDataPushReceived category:" + _category); }; EngagementReach.Base64DataPushReceived += (string _category, byte[] _data, string _body) => { Display("Base64DataPushReceived category:" + _category); }; EngagementReach.Initialize(); EngagementAgent.StartActivity("home"); EngagementAgent.GetStatus(OnStatusReceived); }
// // This method is invoked when the application has loaded and is ready to run. In this // method you should instantiate the window, load the UI into it and then make the window // visible. // // You have 17 seconds to return from this method, or iOS will terminate your application. // public override bool FinishedLaunching(UIApplication app, NSDictionary options) { //MobileEngagementとの接続初期化 EngagementConfiguration config = new EngagementConfiguration { ConnectionString = connectionString, NotificationIcon = UIImage.FromBundle("push") }; EngagementAgent.Init(config); if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0)) { var pushSettings = UIUserNotificationSettings.GetSettingsForTypes( (UIUserNotificationType.Badge | UIUserNotificationType.Sound | UIUserNotificationType.Alert), null); UIApplication.SharedApplication.RegisterUserNotificationSettings(pushSettings); UIApplication.SharedApplication.RegisterForRemoteNotifications(); } else { UIApplication.SharedApplication.RegisterForRemoteNotificationTypes( UIRemoteNotificationType.Badge | UIRemoteNotificationType.Sound | UIRemoteNotificationType.Alert); } global::Xamarin.Forms.Forms.Init(); LoadApplication(new App()); return(base.FinishedLaunching(app, options)); }
protected internal override void onCreate(Bundle savedInstanceState) { base.onCreate(savedInstanceState); mEngagementAgent = EngagementAgent.getInstance(this); }
protected override void OnResume() { //Mobile Engagement リアルタイム監視の開始 EngagementAgent.StartActivity(EngagementAgentUtils.BuildEngagementActivityName(Java.Lang.Class.FromType(this.GetType())), null); base.OnResume(); }
protected override void OnPause() { //Mobile Engagement リアルタイム監視の終了 EngagementAgent.EndActivity(); base.OnPause(); }
public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken) { // Register device token on Engagement EngagementAgent.RegisterDeviceToken(deviceToken); }
public void StartActivity(string pageName, Dictionary <string, string> extra = null) { EngagementAgent.StartActivity(pageName, extra); }
public void SendEvent(string eventName, Dictionary <string, string> extra = null) { EngagementAgent.SendEvent(eventName, extra); }
public void SendError(string errorName, Dictionary <string, string> extra = null) { EngagementAgent.SendError(errorName, extra); }
public void SendAppInfo(Dictionary <string, string> appInfo) { EngagementAgent.SendAppInfo(appInfo); }