Beispiel #1
0
 public override void OnCreate()
 {
     base.OnCreate();
     // Log.d(TAG, "onCreate");
     PushManager.StartWork(ApplicationContext, PushConstants.LoginTypeApiKey,
             "hhN9CFi3gZPpm9LD5szBT8hn");
 }
        /// <summary>
        /// Call this to initialize Baidu's push notification service for this device.
        /// 调用此功能开启百度推送通知服务。
        /// </summary>
        public static void InitializeBaiduPushManager(Context context)
        {
            string baiduPushApiKey = GetMetaDataValueByName("baidu_api_key");

            if (!string.IsNullOrWhiteSpace(baiduPushApiKey))
            {
                PushManager.StartWork(context, PushConstants.LoginTypeApiKey, baiduPushApiKey);
            }
        }
Beispiel #3
0
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.tabs;
            ToolbarResource   = Resource.Layout.toolbar;

            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);
            LoadApplication(new App(new AndroidInitializer()));

            PushManager.StartWork(this.ApplicationContext, PushConstants.LoginTypeApiKey, "trcK2e7vlMfN0StPx8n8Pb4M");
        }
Beispiel #4
0
        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());

            //RegisterReceiver(new NotificationDemo.Droid.NotifyMessageReceiver(), new IntentFilter(""));
            PushManager.StartWork(ApplicationContext, PushConstants.LoginTypeApiKey, ConfigurationSettings.API_KEY);
            PushSettings.EnableDebugMode(ApplicationContext, true);
            //JPushInterface.SetDebugMode(true);
            //JPushInterface.Init(this);

            //var name = typeof(MainActivity).Assembly.ToString();
        }
Beispiel #5
0
        public async Task <bool> InitNotificationHubAsync(string hubName, string hubConnectionString, string[] marks)
        {
            isRegisted = null;
            userMarks  = marks;


            //Java.Lang.JavaSystem.LoadLibrary("libbdpush_V2_7");

            NotifyMessageReceiver.Binded += BaiduBinded;
            PushSettings.EnableDebugMode(Xamarin.Forms.Forms.Context, true);
            PushManager.StartWork(Xamarin.Forms.Forms.Context, PushConstants.LoginTypeApiKey, BiaduConfigurationSettings.API_KEY);



            while (isRegisted == null)
            {
                await Task.Delay(50);
            }
            return(isRegisted.Value);
        }
Beispiel #6
0
 public SplashScreen()
     : base(Resource.Layout.SplashScreen)
 {
     PushManager.StartWork(this.ApplicationContext, PushConstants.LoginTypeApiKey, "c93U79MscdMTli9RSxBn4pI2 ");
 }
Beispiel #7
0
 public static void InitNotification()
 {
     PushManager.StartWork(Xamarin.Forms.Forms.Context, PushConstants.LoginTypeApiKey, BiaduConfigurationSettings.API_KEY);
 }