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(); }
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); }