¿Cómo obtener parámetros adicionales de enlace dinámico con Firebase?

He creado el acoplamiento dinámico manualmente y fijé algunos parámetros adicionales en el acoplamiento, como esto: https://XXXXX.goo.gl/?link=https%3A%2F%2Fairbanq.send.com%2Fsendmoney&apn=com.xxxx. Xxxx & amv = 1 & nombre de usuario = Adri & amount = 7,00

Pero cuando la aplicación se abre recibo: "https: // airbanq.send.com/sendmoney" sin los parámetros addiotional

Estoy utilizando este código de ejemplo https://github.com/firebase/quickstart-android/tree/master/dynamiclinks

Cualquier ayuda por favor,

Gracias

Mi código

public String buildDeepLink() { // Get the unique appcode for this app. String appCode = AirBanqApp.mContext.getString(R.string.app_code); // Get this app's package name. String packageName = AirBanqApp.mContext.getPackageName(); // Build the link with all required parameters Uri.Builder builder = new Uri.Builder() .scheme("https") .authority(appCode + ".app.goo.gl") .path("/") .appendQueryParameter("link", deepLink) .appendQueryParameter("apn", packageName); // If the deep link is used in an advertisement, this value must be set to 1. if (isAd) { builder.appendQueryParameter("ad", "1"); } // Minimum version is optional. if (minVersion > 0) { builder.appendQueryParameter("amv", Integer.toString(minVersion)); } if (!TextUtils.isEmpty(androidLink)) { builder.appendQueryParameter("al", androidLink); } if (!TextUtils.isEmpty(playStoreAppLink)) { builder.appendQueryParameter("afl", playStoreAppLink); } if (!customParameters.isEmpty()) { for (Map.Entry<String, String> parameter : customParameters.entrySet()) { builder.appendQueryParameter(parameter.getKey(), parameter.getValue()); } } // Return the completed deep link. return builder.build().toString(); } 

Esa fue mi solución

I resolvió mi problema, asumí el "apn", "nombre de usuario" y "cantidad" eran parte del parámetro "LINK" en la url, pero no cuando agrego el "y" estoy añadiendo partes a la url principal, Para agregar parámetros al campo "LINK" necesito crear primero la url como esta

https://airbanq.send.com/sendmoney?username=Adri&amount=7.00

Entonces utilice URLEncoder.encode (queryParameters.toString (), "UTF-8"); Para generar este https% 3A% 2F% 2Fairbanq.send.com% 2Fsendmoney% 253Fusername% 253DAdri% 2526amount% 253D7.00

Y luego añadir a url principal

https://xxxx.app.goo.gl/?link=https%3A%2F%2Fairbanq.send.com%2Fsendmoney%253Fusername%253DAdri%2526amount%253D7.00&apn=com.airbanq.airbanqapp&amv=1

  public String buildDeepLink() { // Get the unique appcode for this app. String appCode = AirBanqApp.mContext.getString(R.string.app_code); // Get this app's package name. String packageName = AirBanqApp.mContext.getPackageName(); String queryParamters = ""; try { queryParamters = generateQueryParameters(); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } if (!TextUtils.isEmpty(queryParamters)) { deepLink = deepLink + queryParamters; } // Build the link with all required parameters Uri.Builder builder = new Uri.Builder() .scheme("https") .authority(appCode + ".app.goo.gl") .path("/") .appendQueryParameter("link", deepLink) .appendQueryParameter("apn", packageName); // If the deep link is used in an advertisement, this value must be set to 1. if (isAd) { builder.appendQueryParameter("ad", "1"); } // Minimum version is optional. if (minVersion > 0) { builder.appendQueryParameter("amv", Integer.toString(minVersion)); } if (!TextUtils.isEmpty(androidLink)) { builder.appendQueryParameter("al", androidLink); } if (!TextUtils.isEmpty(playStoreAppLink)) { builder.appendQueryParameter("afl", playStoreAppLink); } // Return the completed deep link. return builder.build().toString(); } private String generateQueryParameters() throws UnsupportedEncodingException { StringBuilder queryParameters = new StringBuilder(); //server purposes queryParameters.append("?*code*"); if (!customParameters.isEmpty()) { for (Map.Entry<String, String> parameter : customParameters.entrySet()) { queryParameters.append(String.format("&%1s=%2s", parameter.getKey(), parameter.getValue())); } } return URLEncoder.encode(queryParameters.toString(), "UTF-8"); } 
  • Enlace dinámico de Firebase que no abre la aplicación
  • ¿Cuál es el código de aplicación utilizado para crear el vínculo profundo de la URL en Firebase para Android
  • FlipAndroid es un fan de Google para Android, Todo sobre Android Phones, Android Wear, Android Dev y Aplicaciones para Android Aplicaciones.