Posts

Showing posts with the label google-play-services

GoogleFit distinguish data between from different devices

I am using GoogleFit HistoryAPI for get step data from user. It's working well. However, in my case, I want to distinguish data between from different devices (using same account) because I don't want user using same account for 2 or more devices (it is a game base on step so I don't want user play on 1 device and have achievement on many devices). I found that Device from DataSource#getDevice, Device#getLocalDevice can help me distinguish data between from different devices. Below is info from official docs: To get information about the device for a data source, use the DataSource.getDevice method. The device information is useful to distinguish from similar sensors on different devices, show the device information from a sensor to the user, or process data differently depending on the device. For example, you may be interested in reading data specifically from the a sensor on a wearable device but not from the same type of sensor on the phone. To get a Device instance f...

Android Billing how to use setAccountId or assign payment to custom identifier

Image
I would like to **allow my users using my app across multiple devices **. Users have to log into my app through firebase auth. Problem is that payments are assigned to account that is signed on the device (google play) , not with account signed into the app.** From firebase auth I can get an email address of the user of my app - this could be used as some unique identifier. Problem visualized: I noticed that in Billing flow there is .setAccountId("some id") I think I could use this to fill in a unique identifier of a user. But how can use it querying purchases? TLDR : All I want to do is to retrieve purchases that are connected to my APP user account, not device account (google play currently logged in user) . To implement billing using accountId , try using the getBuyIntentExtraParams() method which provides additional functionality as compared with getBuyIntent() method. With this method, you may use accountId with the following description: Optional obfuscated string...