how many "likes" do i get by default when queuing FB graphAPi? - java

I'm using Facebook Grap API tool
to simulate queries before I run them from my android app.
I want to get the users' likes and interests.
However i think the result doesn't include all the user likes and interests.
what is the default number it returns?
how can i ask for all the items?

Related

Can't read Google Pay Pass event card through another phone's NFC reader

I need to make an app that is able to read the Google Pay Pass event ticket through NFC. But I can't find any way how to deal with it. I saw some top apps in Google Play, as PassWallet and Passes, which works with such event tickets.
But they all could add a new ticket through scanning barcode only, not through NFC touch. I tried to open a ticket in Google Pay app and read it through another phone's NFC reader but didn't receive any information about the ticket, I always receive my default credit card info even when I open needed card.
So my question is that is it possible to read Google Pay Pass event ticket through another phone's NFC, as in the picture below?
If yes, could you share with me some example codes on how to do it?
Yes it is possible.
For a Google Pay issued pass the pass must be saved to google pay on the mobile device and that passes class must be set to enable smart tap and the pass itself must have the smartTapRedemptionValue field set as below:
{
...
"smartTapRedemptionValue": "Value to Transmit",
...
}
The device acting as the terminal (reads the pass) must implement the Smart Tap Protocol and present the collector id, and signed payload to the mobile device to authenticate the terminal and send passes that it can redeem.
The passes class also has the field redemptionIssuers can specify which terminal's collector id can redeem it.
In order to implement Smart Tap Protocol you can request access to the NDA protected docs via a form and that has the details on how to configure a device acting as a terminal to read passes.
There are also already certified supported terminal providers available.

Salesforce: Which API to use without Login required?

I'm currently working on a native Android app for my company and ran into some problems with Salesforce lately.
I hope I can find some help here.
What I want to achieve:
The company has a lot of Accounts in Salesforce with 3 important fields for the app: Name, Business (Workshop or Parts Dealer) and location(latitude, longitude)
I would like to show those Accounts(Workshops/Parts Dealers) as markers on a google map in my Android app based on a radius around the user's current location. So it would be more than sufficient to get the data as JSON or XML(i read about sObjects, which would be nice too)
The app will be freely available on Google Play Store and every user should be able to see all the Workshops/Parts dealers around the world.
The problem I'm facing is that I can't find a way to fetch the data inside my app without authenticating every user with a Salesforce-Login. 
Which API is the best to use in this case?
It would be so awesome if anybody could help me with this problem.
What I tried so far: 
- SalesforceMobileSDK: If i extend SalesForceApplication() i always end up with the Salesforce-Login Screen.
It seems that every client has to be authenticated for API-calls to work. I tried using the method peekUnauthenticatedRestClient(), but this method only works on full path URL's(e.g. "https://api.spotify.com/v1/search?q=James%20Brown&type=artist"), which isn't really practical for my Use-case.
I feel like I read nearly all docs about salesforce API, but can't quite get my head around how to solve this problem, although it seems like to be a pretty common use-case.  
would a salesforce-apex method which would select all records inside a set radius around the user's location to be accessible without authentication?
Thanks for your help in advance!
Roman
Try asking on salesforce.stackexchange.com. Your question is more about licensing model than a particular programming problem. It might even be the case that you don't really need Salesforce for your project, you'd be better off on Heroku (even free tier) if the login piece is an issue...
All Salesforce APIs require some form of authentication. If you're positive you don't want to hardcode "Integration user" credentials in the app and you don't want to pay for (self-)registered user licenses in your org...
Try to read about these:
Site - piece of Visualforce running under specific "guest user", letting you view & interact with SF data without having to log in. You expose SF data to the world but that means it's your job to handle security (if any) and craft the API. You want to really display the data to human? Or just return JSON content or what...
Sites are meant to be displayin some incentive to contact you. Your product catalog / basic order form. Some map of nearby locations. Maybe a "contact us" form. There's limit on the traffic so eventually they'll explode as your app gets popular:
Customer Community - typically you need named licenses (even if they're fairly cheap) to let your customers log in to your SF. You create a Contact, click magic button - boom, this Contact now has a real matching User record with its own license. Think of it as some kind of step up from Sites - it'll still have some limits but will offer more than just raw API access and you'll have better control on what's going on.

Tracking a variable using Google Analytics

I'm extremely new to Google Analytics on Android.
I've searched quite a bit for this, but I'm not sure I have understood it correctly, but here goes :
I want Google Analytics to track a particular variable in my app.
So for instance, a variable a has a separate value for every user of the app, is it possible for me to display the average of the value of the variable in a Google Analytics dashboard ?
As per my understanding goes, we can do this using Custom Dimensions and Metrics.
I haven't been able to find any tutorial for the same.
I'd be grateful if someone could help me with a tutorial or point me to something other than the developer pages from Google.
Thank You!
UPDATE
Firebase Analytics is now Google’s recommended solution for mobile app analytics. It’s user and event-centric and comes with unlimited app event reporting, cross-network attribution, and postbacks.
Older Answer
You may use GA Event Tracking
Check this guide and this one to check rate limits before you try this.
Events are a useful way to collect data about a user's interaction
with interactive components of your app, like button presses or the
use of a particular item in a game.
An event consists of four fields that you can use to describe a user's
interaction with your app content:
Field Name Type Required Description
Category String Yes The event category
Action String Yes The event action
Label String No The event label
Value Long No The event value
To send an event to Google Analytics, use HitBuilders.EventBuilder and send the hit, as shown in this example:
// Get tracker.
Tracker t = ((AnalyticsSampleApp) getActivity().getApplication()).getTracker(
TrackerName.APP_TRACKER);
// Build and send an Event.
tracker.send(new HitBuilders.EventBuilder()
.setCategory("Achievement")
.setAction("Earned")
.setLabel("5 Dragons Rescued")
.setValue(1)
.build());
On GA console you can see something like this:
where event value is
and avg value is
If you want to track users with specific attributes/traits/metadata then custom dimensions can be used to send this type of data to Google Analytics.
See Set up or edit custom dimensions (Help Center) and then update the custom dimension value as follows:
// Get tracker.
Tracker t = ((AnalyticsSampleApp) getActivity().getApplication()).getTracker(
TrackerName.APP_TRACKER);
t.setScreenName("Home Screen");
// Send the custom dimension value with a screen view.
// Note that the value only needs to be sent once.
t.send(new HitBuilders.ScreenViewBuilder()
.setCustomMetric(1, 5)
.build()
);
It is possible to send additional data to Google Analytics, using either Custom Dimensions or Custom Metrics.
Custom Dimensions are used for labels and identifiers that you will later use to separate your data. For example, you might have a Custom Dimension that tracks log-in status. This would allow you to break down your reports and compare logged-in traffic to not logged-in. These can contain text; while AB testing your site you might set up a custom dimension with the options 'alpha' and 'beta'. They can also contain numeric values, such as the time '08:15', or a unique identifier that you've generated (although you should be careful to follow Google's advice here, lest you include PII and rick account deletion https://developers.google.com/analytics/solutions/crm-integration#user_id).
Custom Metrics are used for numeric variables such as engagement time, or shopping cart value. They are a lot like custom dimensions, but are intended to be compared across dimensions. For example, you could compare the shopping basket value of your Organic users to those who come in via a paid link.
If you wanted to calculate an average, you would also require a calculated metric. This takes two metrics you already have, and produces a third. For example, if you site was all about instant engagement, and you wanted to track the time before the first click event on each page, you could set up that event click time as a custom metric. But this would only tell you what the total is; surely more customers are a good thing, but they make that total go up! So you set up a calculated metric that divides this total by the number of page views, giving you a value per page viewed.
There's a great guide by Simo Ahava about tracking Content Engagement that includes instructions for setting up Custom Metrics and Calculated Metrics.
http://www.simoahava.com/analytics/track-content-engagement-part-2/
However, I should warn you that his guide uses Google Tag Manager, which greatly simplifies the process of adding such customisation to your tags. If you don't want to take that step, you will have to code it manually, as recommended by Google's support https://support.google.com/analytics/answer/2709828?hl=en

How to get around the Twitter 3200 status limit? [duplicate]

With https://dev.twitter.com/docs/api/1/get/statuses/user_timeline I can get 3,200 most recent tweets. However, certain sites like http://www.mytweet16.com/ seems to bypass the limit, and my browse through the API documentation could not find anything.
How do they do it, or is there another API that doesn't have the limit?
You can use twitter search page to bypass 3,200 limit. However you have to scroll down many times in the search results page. For example, I searched tweets from #beyinsiz_adam. This is the link of search results:
https://twitter.com/search?q=from%3Abeyinsiz_adam&src=typd&f=realtime
Now in order to scroll down many times, you can use the following javascript code.
var myVar=setInterval(function(){myTimer()},1000);
function myTimer() {
window.scrollTo(0,document.body.scrollHeight);
}
Just run it in the FireBug console. And wait some time to load all tweets.
The only way to see more is to start saving them before the user's tweet count hits 3200. Services which show more than 3200 tweets have saved them in their own dbs. There's currently no way to get more than that through any Twitter API.
http://www.quora.com/Is-there-a-way-to-get-more-than-3200-tweets-from-a-twitter-user-using-Twitters-API-or-scraping
https://dev.twitter.com/discussions/276
Note from that second link: "…the 3,200 limit is for browsing the timeline only. Tweets can always be requested by their ID using the GET statuses/show/:id method."
I've been in this (Twitter) industry for a long time and witnessed lots of changes in Twitter API and documentation. I would like to clarify one thing to you. There is no way to surpass 3200 tweets limit. Twitter doesn't provide this data even in its new premium API.
The only way someone can surpass this limit is by saving the tweets of an individual Twitter user.
There are tools available which claim to have a wide database and provide more than 3200 tweets. Few of them are followersanalysis.com, keyhole.co which I know of.
You can use a tool I wrote that bypasses the limit.
It saves the Tweets in a JSON format.
https://github.com/pauldotknopf/twitter-dump
You can use a Python library snscrape to do it. Or you can use ExportData tool to get all tweets for the user, which returns already preprocessed CSV and spreadsheet files. The first option is free, but has less information and requires more manual work.

How can you send the exact number of notification (the number next to your apps) to facebook instead of each time we make a request?

I'm trying to have more control on the number we have next to our apps for the user, How can we just send the exact number to show instead of sending notification that increment that number each time.
Basically the current behavior is :
Friend ask for something or give me a gift it increase the number
If another friend send me something its increase the number.
When I log to the game all the counter is reset.
Wanted behavior :
When I log to the game and i go see only one friend on the counter for this friend is reset.
We are currently using facebook-java-api but we will probably merge to restfb soon.
But if you know how to do it in any language it will probably help.
The old dashboard api support the set_count method that can reset to 0 or put the value you want for your apps.
See http://developers.facebook.com/docs/reference/rest/dashboard.setCount/
However the facebook-java-api don't support setCount but the newer restFB does so we need to update our apps to the new api.
EDIT: Note that you and extend the BasicClient and create a custom IFacebook Method with facebook-java-api it`s not clean but it do the trick utils we upgrade to a new facebook api.

Categories