Branch.io referral implementation not working in web app - reactjs

I am using branch SDK in the mobile app for which I am working on for more than 2 years now. I want to have the referral feature in our web application as well. I have followed the web app integration guidelines and has integrated branch in my app. I am using v2.54.2 of branch SDK and v16.13.1 of React.
I am facing a strange issue after integrating. I am calling the branch.logout() method while the user logs out of the application. But after the user logs in back (either to the same user account or to a different user account in our application), none of the branch functionalities work. (branch.setIdentity(), branch.credit(), branch.redeem() etc.). I am getting the following error in the console
Uncaught Error: Invalid JSON string: [object Object]
at ia (build.min.js?cd67:7)
at d (build.min.js?cd67:57)
at Mb (build.min.js?cd67:57)
at eval (build.min.js?cd67:146)
at eval (build.min.js?cd67:135)
at k (build.min.js?cd67:66)
at XMLHttpRequest.Sb.g.onreadystatechange (build.min.js?cd67:64)
I’m not even able to identify which method is causing this error. The branch APIs won’t work even if I do a hard reload. After days of debugging what I found is all the functionalities will work if I open the app in a new tab and close the current tab. But if the user logout and login from the new tab, the issue comes back.
What I suspect is the global branch object, while logging out is not getting reset to the initial state. Can anyone please help me with this issue? I am stuck with this issue for more than 2 weeks now

Related

Webview missing from Chrome

We have an embedded microApp that is setup on a thirdparty website (Saba) that is designed to pass a session token to our Application. We are initiating a User login by presenting them an embedded browser session using WebView2 in our wpf application. Then after a successful login the microApp on the Saba homepage passes back a session token. This appears to be where the application is hanging, waiting for the valid session token to be returned.
This had been working great up until the last 24 hrs, when we are experience hangs on logging in. It appears that trying to access webview via the console/inspector from Edge doesn't work either. "window.chrome.webview" shows undefined.
We are actively scouring any reference we can find to see if there is information about webview support being deprecated or moved but we haven't yet. If anyone has any ideas or resources of where we may be able to find some answer that would be much appreciated.

Angular App getting Access Denied from IE11 when going through Intranet

This is a weird problem and I apologize beforehand that I may not give enough details:
We have a pretty standard Angular app that needs to access an API on a different (sub-)domain, using CORS. Everything works perfectly fine on Chrome and Firefox. We also got it working on IE >=9.
Unfortunately, some of our customers need to access our public website from within their company intranet. In this case, using IE, only a couple API requests go through. Chrome and Firefox cause no problems.
They can create a sessionThey get the result of a second GET requestBut the third request fails
In the console, we see an Access Denied message caused by a GET request.
**AND**: When they reload the page, the third request goes through. One customer could bypass his intranet and access our website directly. Then, everything worked like a charm.
Please note that we are only aware of issues with IE 11.
Any help is really appreciated.

Single Page App: Force Users to Log Out or Refresh

I have created a single page app using AngularJS and ASP.NET MVC 3. When deploying a new version of the application, it's possible for users to be already logged in as the application is being updated. If these users don't either refresh their browser or log out and back in again to get the new JavaScript files, they will encounter lots of errors and could potentially create invalid data.
Question: in a single page app, is there an elegant way to either prompt users to either refresh their browser or log out and back in again?
I suppose this would be possible through Web Sockets / SignalR, but are there other options?
One generic way I could see is to have your angular app send a client-version # with any http request, and your .NET side watch for that number and when it's out of date ( a newer version has been deployed ) send an error response which you would capture in your angular app. You could then just trigger a refresh or prompt the user to refresh and get the latest version.

ASP.NET single page application or MVC app and 404.15

I created a ASP.NET single page application. When I run it I get the following 404.15 error. I see the same error with an MVC application without a Web API in it also.
I commented out the ConfigureAuth code as below:
public partial class Startup
{
public void Configuration(IAppBuilder app)
{
//ConfigureAuth(app);
}
}
Now I get another error which is below:
I tried to duplicate this on a different laptop, and I don't see a problem there.
Is this a directory level permission issue on this particular laptop where I created the app? Appreciate anyone can shed some light on this to fix this.
UPDATE 11/9/2014
I did some further debugging and found that the applications works fine with no authentication and Windows Authentication. When the authentication is forms, I see this problem happening. As you see in the IntelliTrace, the GET request is looping back to Account/Login multiple times and finally give with a 404.15 error. I added a authorization section in the web.config to allow all users to access the resources with , I still see the errors.
I see a major difference between how my laptop and the surface pro 2 behaving with the same application. In my surface pro 2, the home page is displayed and the redirect to account/login never happens. But in the laptop the redirection is happening to account/login.
There are tables in the surface pro 2 created by the asp.net identity. But in my laptop there are no tables. I believe when the application starts, there is no requirement for the tables and the control should go to the home page.
I hope anyone can provide an answer with my additional info.
At first sight looking at the requestedUrl it may be the case that you are always redirecting to the same page (the login page) which creates an infinite redirect loop until the request url becomes too long: Since there is no code I can't be sure about it but I would suggest you to check your redirect url. The authentication appears just because you outcommented the ConfigureAuth method but I don't think it will solve the problem.

Problems using Twitter4j on GAE throws 401 just after deploy

Well, I'm having a weird error here:
I'm developing one GAE app to read some Twitter Data, and after read a lot of docs, I have it working on my test server (Running on my pc) but after deploy and test on the real (my appspot domain) it shows this message:
401:Authentication credentials (https://dev.twitter.com/pages/auth) were missing or >incorrect. Ensure that you have set valid consumer key/secret, access token/secret, and the >system clock is in sync.
message - Could not authenticate you
code - 32
I've tried to recreate my OAuthAppToken and OAuthAppTokenSecret keys, even changing the permissions to "Write, Read and Direct Messages" and even assingning one Callback URL but nothing seems to work...
I've tried using twitter4j.properties OR using setOAuthConsumer(TW_CONSUMER_KEY, TW_CONSUMER_SECRET) OR a ConfigurationBuilder whith the correct constants and I'm experimenting the same Issue.
I'm working with AppEngine 1.8.3 and Twitter4j 3.0.4
Iv'e been writing on log and the Twitter object seems to be well created... I dont understand why is working on my PC but not on the real app.
On some other post someone says that could be because it needs to use Sync clock.. but he doesn't explains where to change that property...
Did someone had a clue?
Ok, the problem was me (and Twitter.... well..... I really think it was Twitter problem for being so dark on his api messages)...
On testing server I was looking for an existing account and on the cloud I was looking for an inexistent one. So, It was my mistake. But seriously, what about Twitter saying: "Access Forbidden"? That doesn't have any sense...

Resources