public override void onReceive(Context context, Intent intent)
	  {
		/* Handle push message */
		string category = intent.getStringExtra("category");
		string body = intent.getStringExtra("body");
		string type = intent.getStringExtra("type");
		if (body == null || type == null)
		{
		  return;
		}

		/* If text then use onDataPushStringReceived function */
		bool? result;
		if (type.Equals("text/plain"))
		{
		  result = onDataPushStringReceived(context, category, body);
		}

		/* If base64 or binary file then use onDataPushBinaryReceived function */
		else if (type.Equals("text/base64"))
		{
		  result = onDataPushBase64Received(context, category, Base64.decode(body, DEFAULT), body);
		}

		/* Unknown type */
		else
		{
		  return;
		}

		/* Set result if defined */
		if (result == null)
		{
		  return;
		}
		int code;
		if (result.Value)
		{
		  code = RESULT_OK;
		}
		else
		{
		  code = RESULT_CANCELED;
		}
		setResult(code, null, null);
	  }
		public override void onReceive(Context context, Intent intent)
		{

			string data = intent.getStringExtra("extra_action_data");

			if (data != null)
			{
				Toast.makeText(context, data, Toast.LENGTH_SHORT).show();
			}
		}
	  public override void onReceive(Context context, Intent intent)
	  {
		/* Registration result action */
		string action = intent.Action;
		if (INTENT_ACTION_REGISTRATION.Equals(action))
		{
		  /* Handle register if successful (otherwise we'll retry next time process is started) */
		  string registrationId = intent.getStringExtra(INTENT_EXTRA_REGISTRATION);
		  if (registrationId != null)
		  {
			EngagementNativePushAgent nativePushAgent = EngagementNativePushAgent.getInstance(context);
			nativePushAgent.registerNativePush(new EngagementNativePushToken(registrationId, ADM));
		  }
		}

		/* Received message action */
		else if (INTENT_ACTION_RECEIVE.Equals(action))
		{
		  EngagementNativePushAgent.getInstance(context).onPushReceived(intent.Extras);
		}
	  }
        public override void onReceive(Context context, Intent intent)
        {
            /* Registration result action */
            string action = intent.Action;

            if (INTENT_ACTION_REGISTRATION.Equals(action))
            {
                /* Handle register if successful (otherwise we'll retry next time process is started) */
                string registrationId = intent.getStringExtra(INTENT_EXTRA_REGISTRATION);
                if (registrationId != null)
                {
                    /* Send registration id to the Engagement Push service */
                    EngagementNativePushAgent nativePushAgent = EngagementNativePushAgent.getInstance(context);
                    nativePushAgent.registerNativePush(new EngagementNativePushToken(registrationId, GCM));
                }
            }

            /* Received message action */
            else if (INTENT_ACTION_RECEIVE.Equals(action))
            {
                EngagementNativePushAgent.getInstance(context).onPushReceived(intent.Extras);
            }
        }
        public override void onCreate(Bundle savedInstanceState)
        {
            base.onCreate(savedInstanceState);

            string AIS_TARGET_URL = Resources.getString([email protected]_target_url);

            Intent intent = Intent;
            string url    = intent.getStringExtra(AIS_TARGET_URL);

            ContentView           = R.layout.ais_webview_activity_main;
            webView               = (WebView)findViewById(R.id.sampleWebView);
            webView.WebViewClient = webViewClient;

            webView.Settings.JavaScriptEnabled = true;
            webView.Settings.JavaScriptCanOpenWindowsAutomatically = true;

            // Append '?responsemethod=redirect' to the AIS call, otherwise we
            // will not get the proper redirects to complete authentication.
            Uri.Builder builder = Uri.parse(url).buildUpon();
            builder.appendQueryParameter("responsemethod", "redirect");
            url = builder.build().ToString();

            webView.loadUrl(url);
        }
	  /// <summary>
	  /// Called when a push message is received or message download completes. </summary>
	  /// <param name="context"> context. </param>
	  /// <param name="intent"> intent. </param>
	  private void onMessage(Context context, Intent intent)
	  {
		string type = intent.getStringExtra(INTENT_EXTRA_TYPE);
		if (INTENT_EXTRA_TYPE_PUSH.Equals(type))
		{
		  EngagementReachAgent.getInstance(context).onContentReceived(intent.Extras);
		}
		else if (INTENT_EXTRA_TYPE_DLC.Equals(type))
		{
		  EngagementReachAgent.getInstance(context).onMessageDownloaded(intent.Extras);
		}
	  }
Ejemplo n.º 7
0
		/// <summary>
		/// Callback when user has selected device in device select activity.
		/// </summary>
		public override void onActivityResult(int requestCode, int resultCode, Intent data)
		{
			if (resultCode == Activity.RESULT_OK)
			{
				mDeviceId = data.getStringExtra("deviceId");
				int type = data.getIntExtra("deviceType", -1);

				if (mDeviceFinder != null && mPickerListener != null)
				{
					SmcDevice d = mDeviceFinder.getDevice(type, mDeviceId);
					if (d != null)
					{
						mPickerListener.onDeviceSelected(d);
						Active = true;
					}
				}
			}
		}