function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Josip Juric87Josip Juric87 

Remote-hybrid app connected to Community shows blank screen after auth token expires

I have a problem with my hybrid-remote app build with the SF Mobile SDK. It is connected to a community (in XCode I have changed the SFDCOAuthLoginHost to the community domain). When the user logs in to the app, everything works. But when he tries to open the app after some time (my guess is, after the oauth token expires), the app just opens a blank screen. If he then closes the app, and re-opens it, it is working normally again.

In SF debug logs, I can see that the app is loading the "/apex/CommunitiesLogin" again and again. But it never ends up in the actual community.

Steps to reproduce the issue:
1) Create a community in your org, and a partner user for the community.
2) Create a conected app for the mobile app.
2) Create a new hybrid remote app, using the forceios CLI.
3) Open the hybrid app in XCode, and change the login URL to the communities' URL.
4) Run the app in a simulator (it shows the login page of the community)
5) Enter the credentials of the user, and login. -> App shows the community.
6) Go on your computer to the Salesforce org, and to Setup > Security Controls > Session Management.
7) Mark all items belonging to the community user, and click on "Remove" (this is to simulate the oauth token expiring)
8) In the simulator, close the app, and re-run.
9) The app shows only a blank screen.

Additional info:
- The connected app has all scopes available
- The issue is not occurring, when I try this with a full-license user login through the app (but, of course, he does not end up in the community)
Phil Bergner 8Phil Bergner 8
Take a look at this post: https://developer.salesforce.com/docs/atlas.en-us.188.0.salesforce_platform_mobile_services.meta/salesforce_platform_mobile_services/hybrid_managing_sessions.htm