How to get app events from Facebook event manager, Facebook Java sdk? - facebook-java-api

I want to receive app events installed from Facebook Events Manager like number of installs, purchases etc.
What I am doing so far is:
var events = new Application("app_id", FacebookUtil.createApiContext(token)).getEvents()
.requestAllFields()
.execute();
It is expected to return events list as in the image, but instead it returns an empty list.
Am I missing something?
Thank you for any help.

Related

ArrowDB - how to get event listener of a chat sent to group?

I'm developing a real time chat app using Titanium Appcelerator. I have everything working with ArrowDB and one user can send another user a message through a group.
https://docs.appcelerator.com/arrowdb/latest/#!/api/Chats
However there doesn't seem to be a method or listener to identify when a new message has been sent to the group.
What I'd like to see is when the other user is typing, and as soon as the message is sent it bubbles up on the recipients chat window. Exactly like how iMessage works.
The only way I can pull new messages from the group to the local users device is to have a refresh button or to use a setInterval with a function call to refresh the messages.
obviously this is not a great way to handle the situation as with a few hundred users every month this would make for hundreds of thousands of api calls and probably not good for device performance.
Does anyone have any ideas how to get real time chat working? Is there a method or event listener I am missing that isn't document?
Push notifications only work while the app is in the background, so this is not an option unfortunately.

Office 365 JavaScript API, redirect back to WP app after launching Store

I am creating a Windows Phone app using HTML And JavaScript. I am able to add connected services and have selected "Users and Groups" and given it Read permissions.
I am then making the following calls on button click:
var authContext = new O365Auth.Context();
authContext.getIdToken("https://TestDomain.onmicrosoft.com/TestWebApi").then(
function (token){
}
);
Services/Office365/Settings.js has been edited to the following:
Settings.clientId = "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
Settings.authUri = "https://login.windows.net/common/";
Settings.redirectUri = "ms-app://s-1-15-2-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx/";
I got the redirectUri value by calling the following function:
Windows.Security.Authentication.Web.WebAuthenticationBroker.getCurrentApplicationCallbackUri();
I do get the login screen for my organization and I am able to provide credentials and it tries to redirect it back to my application, but then I get asked the following question:
"You need to install an app for this task. Would you like to search for one in the Store?"
If I click on yes, it takes me to the store and says "No apps found". If I click on no, it doesn't do anything.
How could I possibly get it redirected back to my app?
The connected services experience only works in Multi-device hybrid apps (a.k.a. Cordova), not in Windows Phone apps.

WinRT live tile badge update

I am currently working on a feed reader app in HTML5/JavaScript and I have a problem with live tiles.
I have a live tile that is updating periodically by querying a web service that is returning the latest 3 articles from a blog.
The live tile works as expected, but I want to create a badge notification that will display the unread articles.
The way I have thought to do this is to see if a tile updates and then increment the number from the badge notification. When the user launches the app, the badge will be cleared.
I use the following lines of code:
var notifications = Windows.UI.Notifications;
var polledUri = new Windows.Foundation.Uri("http://my_url/feed.php");
var recurrence = notifications.PeriodicUpdateRecurrence.halfHour;
var tileUpdater = notifications.TileUpdateManager.createTileUpdaterForApplication()
tileUpdater.startPeriodicUpdate(polledUri, recurrence);
This creates the live tile that updates every half an hour. My problem is: I want to create a badge update every time the PeriodicUpdate takes place. I use the following code:
var badgeType = notifications.BadgeTemplateType.badgeNumber;
var badgeXml = notifications.BadgeUpdateManager.getTemplateContent(badgeType);
var badgeAttributes = badgeXml.getElementsByTagName("badge");
var tileUpdater = notifications.TileUpdateManager.createTileUpdaterForApplication()
tileUpdater.startPeriodicUpdate(polledUri, recurrence);
// this is where my problem is
// if (tileUpdater.update() == true) -> This line is not correct: how can I catch the update event?
//badgeAttributes[0].setAttribute("value", currentValue + 1);
var badgeNotification = new notifications.BadgeNotification(badgeXml);
notifications.BadgeUpdateManager.createBadgeUpdaterForApplication().update(badgeNotification);
I want to catch the update event of that tileUpdater.startPeriodicUpdate function and increment the value of the badge. How can I do that? I have searched everywhere and I could not find an answer.
I appreciate your help.
Julian Atanasoae
Even if you could detect that the periodic tile update has occurred (I'm pretty sure you cannot), it will occur most of the time when your app is NOT running. As a result, the code you have to set the badge update via a "local notification" won't execute. In fact, the badge would only update when the app is in the foreground AND a periodic notification hits (which isn't all that interesting, because with your app in the foreground you're not seeing the tile anyway!).
It sounds like you want to track the number of times the tile was updated by showing that in the badge? (Note that will work only up to 99, the max badge number)
I'd say use a periodic notification for the badge too, and the URL endpoint for that periodic update could be a service that accepts a query string argument uniquely identifying the client. Then your service would generate the correct badge notification for that client, by incrementing a client-specific value that's it's maintaining server side.
Even with this though, you'll have two periodic notifications occurring, one for the tile and one for the badge, and while you can schedule them for the same interval, there's still a potential skew in when they arrive, up to 15 minutes from the desired time.
There are 2 solutions to this problem:
1) I create a periodic notification for a badge update and I store GUIDs for each client on a web service. This solution would work for apps that are not heavily used (under 2000 users), because the XML file would get too big and the web service would have to increment a lot of values for each client.
2) I create a background task with a timer and I check for updates every 15 minutes or so.
Julian

Need a way to alert users when building spotify app

I'm building a spotify app that does some work in the background and should then alert the user if it finds a match. I can't find a way to notify the user on the main plane when I have found something of interest.
I'd like to have something like a counter on my app name or some form of notification in order to alert the user that something has changed in my app and that they should come to the app.
Does anyone know if this is possible ?
thanks,
Sean
You would need to notify them via Facebook, Spotify doesn't allow you to identify the individual users on the Spotify platform through the api.
Also there is the issue of that your App unloads after 60seconds of the user not being on the App Pane (off in a playlist etc).
So whilst a counter icon that you suggest would be wonderful.
The App Unload-er needs to go away first.

Updating application icon Badge in iPhone 3.0, when application is not running

I have an application, which lists number of IM sent by any of my friend using my application. And application icon show number of unread IMs to me. If my application is running in foreground, I can update badge by calling web service every 1 minute which will return number of unread IMs. Suppose, if the person is using iPhone3.0 and application is not running, how can i update the badge? Push notification without alert, but with just number of unread IMs as badge number will work?
Please advice, Thank you.
Yes if the user enables push notifications and allowes it for your app then you can use them to just adjust the badge counter.
At last, we found the problem, the problem is passing badge parameter as string in JSON payload, Now we are sending it as number, so even when the application is in background, badge getting set properly.
Thank you for your all help.