Properly log out a user from android app

后端 未结 6 1562
走了就别回头了
走了就别回头了 2020-12-17 08:46

I\'m developing a small android app, and basically so far it just has login and logout functionality. I\'m using Firebase to store user data and also for authentication.

6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-17 09:39

    Delete tokens and Instance IDs

    String authorizedEntity = PROJECT_ID;  
    String scope = "GCM";
    FirebaseInstanceID.getInstance(context).deleteToken(authorizedEntity,scope);
    

    You can also delete the Instance ID itself, including all associated tokens. The next time you call getInstance() you will get a new Instance ID:

    FirebaseInstanceID.getInstance(context).deleteInstanceID();
    String newIID = InstanceID.getInstance(context).getId();
    

提交回复
热议问题