Closed marioaburto10 closed 1 year ago
Is the browser that your extension runs in different from the one that opens when you click the link in your email?
Is the browser that your extension runs in different from the one that opens when you click the link in your email?
Yes it is
That's the issue then. Unfortunately there's really no way around that that I know of.
In an actual use case (not test mode) will the user be marked as paid when they initialize their trial and click on the link on a different browser? Currently, in my test case, if I reload the options
page and the getUser()
function is called, the user that comes back has the property paid
set as true
while the property trialStartedAt
is set to null
. I am expecting the trialStartedAt
property to have a numeric value even if the onTrialStarted
listener is not called.
For anyone wondering, in an actual start trial use case (not test mode) - the user object that is returned does have the trialStartedAt
property populated even if the user clicks on the trial link on a different browser. The only issue (known) is that the onTrialStarted
listener will not get called but I can work with this. Thank you @Glench for your help.
Issue
onTrialStarted
listener is not getting called when user starts trial in test mode.Expected behavior callback function within
extpay.onTrialStarted.addListener
should be executed after the user clicks on the trial link in their email.Context I click on a button in my
options.html
page that triggers theextpay.openTrialPage()
function. A new window opens up, asking me to enter my email to start my free trial. A link is sent to my email. I click on the link and I get a message saying that I can now use the extension's paid features. I head back to my extension and see that nothing has changed. I inspect my extension and don't see anything in the console. I have aconsole.log
function inside of theonTrialStarted
listener and I see that it never gets called either. It's important to note that the test case where I subscribe, theonPaid
listener works just fine. I'm wondering why theonPaid
listener works fine but theonTrialStarted
listener does not work at all? See my code below.It is also worth noting that if I reload the
options
page and thegetUser()
function is called, the user that comes back has the propertypaid
set astrue
while the propertytrialStartedAt
is set tonull
. I am expecting thetrialStartedAt
property to have a numeric value for the trial test case. Looks like there is a bigger issue with the test trial functionality but not sure.My Setup
background.js
manifest.json