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);
        }
示例#2
0
        //
        // 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));
        }