Firebase dynamic link support custom parameters?

后端 未结 10 1326
野趣味
野趣味 2020-12-29 04:25

I am writing a App for a Open Source Conference.

Originally each attendees will receive different link via email or SMS like

https://example.com/?token=fccfc

10条回答
  •  梦谈多话
    2020-12-29 05:20

    For web apps, which generating dynamic links.

    const data = {
      dynamicLinkInfo: {
        domainUriPrefix: 'subdomain.page.link',
        link: url,
      },
      suffix: {
        option: 'SHORT'
      }
    };
    return fetch(`https://firebasedynamiclinks.googleapis.com/v1/shortLinks?key=${environment.firebaseConfig.apiKey}`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      body: JSON.stringify(data),
    }).then(res => res.json()).then(response => response.shortLink).catch(console.error);
    

提交回复
热议问题