Skip to main content
Answer

Can push notification URL be dynamic as a function of CompanyId?

  • August 10, 2021
  • 3 replies
  • 170 views

Forum|alt.badge.img

Hello, 

Our push notifications are part of our customization project, and we publish our customization project to all three of our tenants to keep them in sync. When we do this, the push notification URL is set to the same value for all three tenants, whereas we need each tenant to use its own specific push notification URL. Is it possible for the push notification URL to be dynamic? We’d like each tenant to use different  push notification URL depending on the CompanyId of the tenant.

Thank you, 

Dave

Best answer by jinin

Hi @dhollinden 

Can you please extend the customization plugin and customize the url to have the company ID as param ?

sample url - https://secure.domain.com/whatever.csp?myparam1=x&myparam2=y

Example:

public class CustomizationPluginExtn : CustomizationPlugin
    {
        public override void UpdateDatabase()
        {

          // - -- write the code to Initialize the Push notification graph and assign the url with companyId as parameter.

         }

}

When ever package publish, dynamically delete the existing Push notification and create new. So we can avoid the duplicate record creations.

3 replies

jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • Answer
  • November 27, 2021

Hi @dhollinden 

Can you please extend the customization plugin and customize the url to have the company ID as param ?

sample url - https://secure.domain.com/whatever.csp?myparam1=x&myparam2=y

Example:

public class CustomizationPluginExtn : CustomizationPlugin
    {
        public override void UpdateDatabase()
        {

          // - -- write the code to Initialize the Push notification graph and assign the url with companyId as parameter.

         }

}

When ever package publish, dynamically delete the existing Push notification and create new. So we can avoid the duplicate record creations.


Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • November 29, 2021

Thank you, @jinin 

Your solution makes a lot of sense. And perhaps with that approach, we could actually assign different URLs based on the companyid, rather than place companyid on the querystring. 

We’ll definitely keep your solution in mind. We already addressed our situation a different way by sending the push notifications from all tenants to the same lambda function, which then routes the notifications to their proper destination based on companyid. 

Many thanks, 

Dave


jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • November 29, 2021

@dhollinden  Thank you for your update!!