question

JassimAlRahma-9056 avatar image
0 Votes"
JassimAlRahma-9056 asked JessieZhang-2116 answered

Force Signout

Hi,

How can I force signout a users from my app by calling SignoutUser()?

My app is a membership app and I don't want the user to keep using the services if they did not pay the fees.

I was thinking for sending Background Notification to the user and then signing out but I ended up with this limitation:

98702-screen-shot-2021-05-21-at-61904-pm.png
Kindly advice..


dotnet-xamarindotnet-standard
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @JassimAlRahma-9056 , what do you mean by words How can I force signout a users from my app by calling SignoutUser()? How can we reproduce this problem?

0 Votes 0 ·
  1. When the user signs in to my app and I am checking if he is signed in using the Xamarin Essentials's Preferences.

  2. When the user signs out I am clearing the Preferences so he won't be able to access the services until he signs in again

  3. So if the user is a member, signed in already to my app and did not sign out but he left the association, I want to send a Background Notification or any other solution so when he starts the app it will clear the Preferences.
    4.

0 Votes 0 ·

1 Answer

JessieZhang-2116 avatar image
0 Votes"
JessieZhang-2116 answered

Hello,


Welcome to our Microsoft Q&A platform!

So if the user is a member, signed in already to my app and did not sign out but he left the association, I want to send a Background Notification or any other solution so when he starts the app it will clear the Preferences.

How can I force signout a users from my app by calling SignoutUser()?

When a user leave the association, the back server should know this, so in this condition, once the user login in this app with the older data(user name and password) from the Preferences, the server should know that this account hasn't pay the fees. In this condition, you can add some logical code in your app to force this user out of the APP instead of let him login in. And at the same time, you can prompt the user: you have not paid, please pay and then try to enter.

Note:

In my opinion, even if you erase the user data by clearing the Preferences, what if the user reenters the information himself? So, it's not the ultimate solution. Therefore, when the user logs in the user information, and after verifying the data with the background server, if it is known that the user has not paid, it is still necessary to prompt the user that he has not paid.

Best Regards,


Jessie Zhang


If the response is helpful, please click "Accept Answer" and upvote it.



Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.







5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.