Android Question firebase messaging with getownedproducts

tufanv

Expert
Licensed User
Longtime User
HEllo,

I am using firebase messaging in my andorid app to send push messages to users. I want to change "send to all" to "send only to members with active subscriptions" so i need to check after receving the push if the users has a active subscription with inapp billing3 manager.getownedproducts.

B4X:
Sub fm_MessageArrived (Message As RemoteMessage)
   Log("Message arrived")
   Log($"Message data: ${Message.GetData}"$)
   Dim n As Notification
   n.Initialize
   n.Icon = "icon"
   n.SetInfo(Message.GetData.Get("title"), Message.GetData.Get("body"), Main)
   n.Notify(1)
End Sub

this is the place where notification is received. but this is a service module ? How can i use manager.getownedprpoducts here and show the notification if a product called "membership" is in the inventroy ?

Thanks
 

tufanv

Expert
Licensed User
Longtime User
Nothing special. You can use BillingManager from a service.
so i will just declare a inappbilling3 in the service module and do the same thing like the main module right =? manager.getownedproducts and manager_ownedproducts sub etc.. ?
 
Upvote 0
Top