I've been reading the real-time updates documentation for a while and I can't seem to find an answer. Can I use this feature only for the app's users? Can't I define a list of IDs that I want to receive the public feed from(even though not app's users)?
Thanks a lot
From the documentation:
Objects
You can currently subscribe to updates for these types of objects:
user – Get notifications about particular fields and connections
corresponding to user nodes in the Graph API.
permissions – Get
notifications when your users change the permissions they afford your
applications. The fields are like those in the corresponding FQL
table.
page - Get notifications when pages that have installed your
application change their public properties. Note that the page topic
is only used for subscribing to changes to public attributes of the
page (like name, category, picture etc). This is the same information
that is returned by the graph api call
https://graph.facebook.com/. You can subscribe to the page's
feed in the same way you subscribe to a user's feed - the subscription
topic should be 'user' and the subscription field should be 'feed'
These objects are related to YOUR application, so it would be updates from users of your applications, permissions related to your application, etc..
Related
I am working on a beta-stage writing tool SaaS that is built with NextJS, React, and Django REST. As I’m gaining some user base, I am starting to research on introducing a premium plan to the mix using Stripe.
As most other SaaSs, I will have a subscription-based premium plan which grants access to premium-only features. However, even after days of research, I am still lost how this is commonly implemented in Django/Backend. Here is what I’ve thought of so far, but again, I am not sure if it’s the best/common way to accomplish this.
User model has a ‘premium’ field which is either True or False
Whenever user clicks on a premium-only API call, Django will check if user is premium or not to decide whether to make the actual API call. I currently have a '/user/me/' route which returns basic user information as API GET call.
Upon successful stripe payment, stripe redirects user to the success_url. Then, somehow I will detect when user lands on success_url and then set that user’s premium field to True.
I know this is not the ideal way, because I already see lots of issues/hurdles:
How will I set ‘premium’ field back to False after user’s payment stops
How can I ‘detect’ stripe’s payment to set user’s premium field
Is this feature supposed to be implemented with Stripe customer objects instead? I would appreciate any guidance on where I should be looking for solutions.
If you use subscription on Checkout Session (low code solution), you can add additional key-value pair data such as premium: true in metadata and subscription_data.metadata fields when creating a subscription.
Once the payment is completed, those metadata will appear in checkout.session.completed and customer.subscription.updated webhook events, which you can then set the user as premium in your own database.
A customer object in Stripe can have multiple subscriptions, so this feature will be implemented on subscription object instead.
Can anyone provide me with working example how to show analytics (Visits, Page views, Page views per visit, etc) for logged users? As I understand there is no OOB solution, so I've tried to implement flexible dimensions, but didn't find any good examples and failed.
First of all you have to identify your logged in contact by calling the Sitecore.Analytics.Tracker.Current.Session.IdentifyAs() method, see more details here. When the contact logs in you can use their username to identify them upon the successful login.
Note, that the identification and authentication are separate unrelated events. Contacts are identified against the xDB and authenticated against the authentication mechanism used by the website.
When the contact identifies, it is saved to xConnect with a known identifier based on the information passed into theIdentifyAs() method: Identifier, Source and
IdentifierType will be set to ContactIdentifierType.Known (it is set to ContactIdentifierType.Anonymous for anonymous contacts). Then you can use IsKnown property on the Sitecore.XConnect.Contact that returns true if a contact has any known identifiers.
If you want to track some custom events for the logged in users to then use them for reporting needs you can add user interactions by calling the client.AddInteraction() extension method. I have given an example here.
If you want to extend the contact with your own custom data then you can create custom contact facets, read more here.
In order to implement your custom report with flexible filtering by logged in and not users, of course, you will need to define your custom dimensions and metrics, read more here.
I've set up a Realtime Subscription for object user and fields feed and I am receiving realtime posts from Facebook.
I'm not interested in getting an update about every little thing that happens on every user's feed though. Is there a way to subscribe to just a single post?
My app is making a post to several user's feeds and then I would simply like my app to monitor anytime that specific post is liked or commented on.
Is it possible to subscribe to a certain post?
In current implementation of Realtime Updates seems like it is impossible, because you can not subscribe to specific object. Furthermore updates information that you receive doesn't contain any identifying information like post ID.
Trying several time to use the music.listen action and ending up trying to create our own listen action and song object.
Some posts suggested that music.listen and songs built in actions and object were for now only available to launch partners.
Can anybody tell if this is true and if yes how we can become a launch partner for the music opengraph ?
Thanks.
known urls :
Using generic open graph objects and actions, and the publish_actions permission?
http://facebook.stackoverflow.com/questions/7602579/opengraph-music-music-listens-returns-error
music.listen is an action only available to selected partners at present. The music.listen action and the Song object are not available for general use.
Facebook are monitoring the ecosystem and will decide at a later date if music.listen is available beyond the existing launch partners.
In the meantime, we suggest you create your own custom 'Play' action and your own custom Song object - custom actions called 'listen' won't currently be approved by Facebook.
I don't know if it's true, but either way it sounds like you will need to have your companies business development team contact Facebook to see if there's still time to become a launch partner.
I am using the facebook graph api and c# sdk to make a desktop facebook application to notify users of new posts and messages in facebook. I can get the news feed (/me/home, in graph api talk), as well as messages, events, pokes, etc, but I have not been able to retrieve notifications such as when one of my friends "friends" someone else, or when one of my friends changes their profile picture. What does facebook call those notifications anyway? So, are those things available with the graph api? What about REST?
You can do such things with Facebook Real-time Updates. You can subscribe to events on objects (user, page or permissions) and Facebook will monitor changes on these object and call a callback url when changes happen.
You can watch changes of fields (name, email, ...) but also connections (friends, likes, inbox, ...).
Let's say you subscribe to the friends connection real-time update for a user. Each time this user will have a new friend, a URL of yours will be called notifying you about the event.
Hope that helps.