• Sign Up Login
  • Features
    • Game Services
    • Real-time Analytics
    • LiveOps
    • Add-ons
  • Game Services
  • Real-time Analytics
  • LiveOps
  • Add-ons
  • Games
  • Pricing
  • Blog
  • Support
    • Docs
    • Forums
    • Contact
  • Docs
  • Forums
  • Contact
  • Sign Up Login
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Ideas
    • Articles
    • Users
    • Badges
  • Home /
  • General Discussion /
avatar image
Question by Dylan Hunt · Mar 17, 2017 at 01:40 PM · Push NotificationsFriends

How would I go about inviting a friend to a party? The notification of invite? Push only for mobile?

I have Photon and Steam. For example, if I want to send a person an invite to my party, how would I go about doing this for a PC game?

Here's what I have in my head:

Option A:

  1. If I have their Playfab ID, could I have a custom info called like "pendingInvite" and make it null by default -- check every 15 seconds or so while at least 1 friend is online.
  2. Since there's no invite push call for PC that I know of (is there?), I should probably make a cloud code function to invite a friend. I could change pendingInvite = the player's playfab ID (I'm not good with cloud code yet, but I think I can do this).
  3. So when that 15 second check triggers and it's not null, pop up "you got an invite!" and clear it back to null.

Is there a better way of doing this, like with the PlayStream? Anything "pushy" for PC?

Option B:

  1. When I want to invite someone, I'll get their Steam ID from PlayFab FriendInfo.
  2. I'll then use Steamworks to push a game invite via Steamworks.
  3. SteamWorks event stream will pick it up and it'll ask for an invite via Steam (and I could show something in-game). If they accept, the original person's steamworks event stream will let them know they accepted - and I already have their info thanks to FriendInfo.

_____________________________

Then....... not quite sure how to both join the same room. Perhaps:

Player2 would get another FriendInfo call and keep doing it until the Player1.PhotonRoomNumber (or whatever it's called) is not null, or after x failed attempts.

Comment

People who like this

0 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Joshua Strunk · Mar 17, 2017 at 03:36 PM

I would note that relying on push notifications for mobile is only really a hack anyway, not a solid solution.

The heartbeat style polling and steam methods should work, however every 15sec is excessive and likely to cause throttling. A key thing to remember is PlayFab is not a real-time messaging service, don't try to use it like one.

The solution we are going with is using another service to handle real-time messaging between users. This is very similar to using Steamworks, in out case our generic works on everything system of choice Photon Chat. If you want to add more authority to the system you can even due the write the PlayerData for invited and then on the sending players client send a ping to the receiving player to pull for the invite.

Comment

People who like this

0 Show 1 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Dylan Hunt · Mar 17, 2017 at 04:30 PM 0
Share

What is the minimum NOT considered realtime? I'm not worried about chat, can use Steam or Discord SDK (just got approved to their program), but in terms of notifications (friend invite, game invite), what's is 30s acceptable without throttles?

Interesting concept about pulling for invite, but seems a bit lame for 2017.

I wonder if you can include info within a steam invite, if I can invite to my own (Photons) server

avatar image

Answer by Brendan · Mar 17, 2017 at 11:41 PM

@Dylan Hunt (this got a bit too long for a Comment)

First, let me state that all the limits in the service have the flexibility to be changed based on custom contracts. So if you ever feel there's something you need, but the service limits prevent it, you can always talk to our business team about what it would cost to have exactly what you do need. Everything below assumes you do not have a custom contract with higher limits.

PlayFab is a Web API based service, so there's no socket connection to the client. We manage to keep our prices low and offer a free tier specifically by making sure that by default, titles don't make an excessive number of calls. In general, you should be aiming for only a few calls a minute on average, over the lifetime of the session for the user, across all calls. So bursts of calls are fine, as long as the average works out.

We've had "burst" rate limiting for some time now, and we're in the process of adding "long-term" rate limiting, in order to help developers get immediate feedback from the service as they build and test their games. As we establish those long-term rate limits, we'll also provide documentation detailing it. But yes, a system that frequently polls PlayFab for info would clearly run into that throttle.

We may be adding something akin to SignalR down the road, but for right now, I would simply not advise trying to build a system like that into the base service, as the polling rate would need to be long enough between calls to impact the user experience. Instead, I would recommend using a system which is specifically designed for real-time communications, like Photon Realtime, or else have your own custom game servers which manage those requests.

Comment
Dylan Hunt

People who like this

1 Show 0 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    1 Person is following this question.

    avatar image

    Related Questions

    Limit number of push notifications. 1 Answer

    Photon + PlayFab matchmaking parties (invite friends) 2 Answers

    Push Notice issue on some platforms, with Unity? 1 Answer

    how to display friend list Because i want to send friend request?? 1 Answer

    iOS VoIP Push Notification support 1 Answer

    • PlayFab

      • Features
      • Games
      • Pricing
      • Blog
    • Engineers

      • Documentation
      • Quickstarts
      • API Reference
      • SDKs
      • Usage Limits
    • Support

      • Forums
      • Videos
      • Contact
      • Service Health
      • Terms of Service
    • Social

      • Facebook
      • Twitter
      • LinkedIn
      • YouTube
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • About Microsoft
    • Jobs
    • Accessibility
    • Diversity & inclusion
    • Security
    • Company news
    • © Microsoft 2019
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Post an idea
    • Create an article
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Ideas
    • Articles
    • Users
    • Badges