예제 #1
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)
		{
			window = new UIWindow (UIScreen.MainScreen.Bounds);
			
			viewController = new PushwooshSampleViewController ();
			window.RootViewController = viewController;
			window.MakeKeyAndVisible ();

			PushNotificationManager pushmanager = PushNotificationManager.PushManager;
			pushmanager.Delegate = this;

			if (options != null) {
				if (options.ContainsKey (UIApplication.LaunchOptionsRemoteNotificationKey)) { 
					pushmanager.HandlePushReceived (options);
				}
			}
			 
			pushmanager.RegisterForPushNotifications ();

			pushmanager.StartLocationTracking ();

			Console.WriteLine("HWID: " + pushmanager.GetHWID);

			return true;
		}
예제 #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)
        {
            window = new UIWindow(UIScreen.MainScreen.Bounds);

            viewController            = new PushwooshSampleViewController();
            window.RootViewController = viewController;
            window.MakeKeyAndVisible();

            PushNotificationManager pushmanager = PushNotificationManager.PushManager;

            pushmanager.Delegate = this;

            if (options != null)
            {
                if (options.ContainsKey(UIApplication.LaunchOptionsRemoteNotificationKey))
                {
                    pushmanager.HandlePushReceived(options);
                }
            }

            pushmanager.RegisterForPushNotifications();

            pushmanager.StartLocationTracking();

            Console.WriteLine("HWID: " + pushmanager.GetHWID);

            return(true);
        }
예제 #3
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)
        {
            window = new UIWindow(UIScreen.MainScreen.Bounds);

            viewController            = new PushwooshSampleViewController();
            window.RootViewController = viewController;
            window.MakeKeyAndVisible();

            PushNotificationManager pushmanager = PushNotificationManager.PushManager;

            pushmanager.Delegate = this;
            UIRemoteNotificationType notificationTypes = UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge;

            UIApplication.SharedApplication.RegisterForRemoteNotificationTypes(notificationTypes);

            if (options != null)
            {
                if (options.ContainsKey(UIApplication.LaunchOptionsRemoteNotificationKey))
                {
                    pushmanager.HandlePushReceived(options);
                }
            }

            pushmanager.StartLocationTracking();

            return(true);
        }
        //
        // 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)
        {
            window = new UIWindow(UIScreen.MainScreen.Bounds);

            viewController            = new PushwooshSampleViewController();
            window.RootViewController = viewController;
            window.MakeKeyAndVisible();

            PushNotificationManager pushmanager = PushNotificationManager.PushManager;

            _pushDelegate        = new PushDelegate();
            pushmanager.Delegate = _pushDelegate;

            //pushmanager.Language = (NSString)"es";

            if (UIDevice.CurrentDevice.CheckSystemVersion(10, 0))
            {
                UNUserNotificationCenter.Current.Delegate = pushmanager.NotificationCenterDelegate;
            }

            if (options != null)
            {
                if (options.ContainsKey(UIApplication.LaunchOptionsRemoteNotificationKey))
                {
                    pushmanager.HandlePushReceived(options);
                }
            }

            pushmanager.SendAppOpen();
            pushmanager.RegisterForPushNotifications();

            //Start tracking Geozones
            PWGeozonesManager.SharedManager.StartLocationTracking();

            pushmanager.SetUserId(new NSString("%userId%"));

            pushmanager.PostEvent(new NSString("applicationFinishedLaunching"), new NSDictionary("attribute", "value"));

            PWInAppManager inappManager = PWInAppManager.SharedManager;

            inappManager.AddJavascriptInterface(new JavaScriptInterface(), new NSString("jsInterface"));
            inappManager.PostEvent(new NSString("1"), new NSDictionary());

            Console.WriteLine("HWID: " + pushmanager.HWID);

            return(true);
        }
예제 #5
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)
        {
            window = new UIWindow (UIScreen.MainScreen.Bounds);

            viewController = new PushwooshSampleViewController ();
            window.RootViewController = viewController;
            window.MakeKeyAndVisible ();

            PushNotificationManager pushmanager = PushNotificationManager.PushManager;
            pushmanager.Delegate = this;
            UIRemoteNotificationType notificationTypes = UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge;
            UIApplication.SharedApplication.RegisterForRemoteNotificationTypes(notificationTypes);

            pushmanager.StartLocationTracking ();

            return true;
        }