开发者

How to determine whether my Android Google account credentials are valid?

开发者 https://www.devze.com 2023-03-31 11:59 出处:网络
After an goo开发者_运维问答gle account is updated, how to determine if credentials for that account are valid? I need to start C2DM communication only after the user enter valid credentials on his pho

After an goo开发者_运维问答gle account is updated, how to determine if credentials for that account are valid? I need to start C2DM communication only after the user enter valid credentials on his phone. I need to check this in Android 2.2


To receive C2DM messages you are right that the device needs the user to be signed into their Google Account, but your app does not need access to the user's password. If the user ends up signed out of their Google Account on the device, then you will know because the C2DM registration will fail. I think that is the right way to check for this - that until you have received a successful registration response, assume the device is not able to use C2DM, and you could then block access to the app's UI, or show a message saying "Before using this app, please make sure you are signed into your Google account"

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号