Menu
Who Do Is
  • Home
  • What
  • How
  • Is
  • Can
  • Are
  • Does
  • Do
  • Why
  • Who
  • Where
  • Which
  • Which
  • Should
  • Will
  • When
  • What’s
  • Did
Who Do Is

[ANSWERED] in app purchase – Dynamically fetch messages published to a Google pub/sub topic in android

Posted on November 14, 2022

Solution 1 :

You would not want to receive the Cloud Pub/Sub message in the application itself. In order to accomplish this, you would need to have a subscription per application instance and Cloud Pub/Sub is not designed to scale that way: the limit is 10,000 subscriptions per topic. Additionally, each instance of the application would receive all notifications for all users, which is likely not what you want.

The purpose of the real time developer notifications is for your service to receive notifications of changes to users’ entitlements. Then, when users make requests to your service from the application, it can respond appropriately based on the subscription features that should be enabled. If you want an application instance to be notified when entitlements change, you’d have to implement that separately in the service in response to the Cloud Pub/Sub notifications. You could use something like Firebase Cloud Messaging to send the appropriate messages to individual application instances. However, you would still need to have a service that acts as a subscriber to Cloud Pub/Sub and gets the messages from the topic for developer notifications and then passes these along to Firebase Cloud Messaging.

Problem :

I am building a app with in-app subscriptions. I have implemented Real Time developer notifications as recommended by Google by properly configuring as mentioned over there. Whenever I purchase or cancel a subscription, SubscriptionNotification is published to the Pub/Sub topic as expected. But I am not able to get that message in the app. My requirement is that whenever message is published to the topic same message must be received inside app without any explicit request. And I have a pull subscription of Google’s Pub/Sub api. So does pull suit here or should I go for push? So any kind of help would be highly appreciated.

READ  [ANSWERED] android - java.lang.IllegalArgumentException: Given String is empty or null
Powered by Inline Related Posts

Comments

Comment posted by Nadeem Shaikh

I got your point but one more question….what should be the type of subscription in Google Pub/Sub topic, Pull or push? I have created a pull. Have I done it right?

Comment posted by Kamal Aboul-Hosn

That depends on how you plan to build your subscriber. If you are going to use put it behind an HTTPS endpoint and you want Pub/Sub to send messages to it, then push is the appropriate choice. If you plan to call the Pub/Sub subscribe API (likely through the client libraries), then pull is the right choice.

Recent Posts

  • How can I play with my cat without toys?
  • What is a bag pipe band called?
  • Are Honda Civics actually fast?
  • Are Yankee candles toxic?
  • How do I pair my Michael Kors smartwatch with my Android?

Recent Comments

No comments to show.

Archives

  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022

Categories

  • ¿Cómo
  • ¿Cuál
  • ¿Cuántas
  • ¿Cuánto
  • ¿Que
  • ¿Quién
  • 90” and 108” so you may have to round up to the nearest size.
  • and delete any Spotify folders from it. Once this is done
  • Android
  • Are
  • At
  • Bei
  • blink
  • C'est
  • Can
  • carbs
  • Comment
  • Did
  • Do
  • Does
  • During
  • For
  • Has
  • How
  • In
  • Is
  • Ist
  • Kann
  • Können
  • nouveau
  • On
  • or 108 inches.2020-08-03
  • Où
  • owning
  • Pourquoi
  • Puis-je
  • Quand
  • Quante
  • Quel
  • Quelle
  • Quelles
  • Quels
  • Qui
  • Should
  • Sind
  • Sollte
  • spiritual
  • tap the downward-facing arrow on the top left. A downward-facing arrow will appear underneath each song in the album; they'll turn green as the download completes.2020-07-28
  • Uncategorized
  • Wann
  • Warum
  • Was
  • Welche
  • Welcher
  • Welches
  • Welke
  • Wer
  • Were
  • What
  • What's
  • When
  • Where
  • Which
  • Who
  • Whose
  • Why
  • Wie
  • Will
  • Wo
  • Woher
  • you will receive two curtains each with the same measurements of width 66"" (168cm) x drop 54""(137cm).
  • you'll see a green downward-facing arrow next to each song.2021-02-26
©2023 Who Do Is | Powered by SuperbThemes & WordPress