FB api for Unity3d. Select all friends - facebook

I use FB api for selecting friends for my app with following code (doc)
FB.AppRequest(
message,
null,
new List<object> (){ "app_users" },
null,
null,
jsonData,
null,
RequestResult
);
But in window with selecting friends is no button Select All. Can I add it to native window? Or I have to write my own window with selecting?

Related

Ionic SocialSharing with pdf file for whatsapp

I am using pdfMaker to create an object of type Document, I would like to send this file to a contact I have saved on Whatsapp, it would be something similar to using the shareViaWhatsAppToReceiver function using SocialSharing.
The file's attachment would already come in the message.
this.socialSharing.shareViaWhatsAppToReceiver(`+55 ${contact.phone}`, `PDF`,
null, this.pdfObj).then(async () => {
const toast = await this._toast.create({
message: 'Send success.',
duration: 3000
});
});
The way I am doing above does not work, I would like to send the document directly as a parameter so that the message on Whatsapp is attached.

Appcelerator - Post a Tweet from iPhone App - Stuck on Callback URL

I am needing to send a tweet for from my iphone/ipad app using Appcelerator Titanium & javascript. I found the following example on github (code also posted below for this):
https://gist.github.com/2eabc31db388144b3abc
I have created my app details (key,secret etc) in my twitter developer account and using the code from the example i get the twitter login and authorisation popup but once you click authorise, all i get is a webview showing the callback url (that i was required to put in the twitter app settings). So the app is stuck on a webview showing the callback url but does nothing after. If i close the popup window it just goes back to my app without sending a tweet.
Can anyone help?
code in app.js:
var win = Ti.UI.createWindow({ backgroundColor: '#fff' });
var shareButton = Ti.UI.createButton({
width: 90, bottom: 10, height: 30,
title: 'Tweet!"'
});
win.add(shareButton);
win.open();
var social = require('social');
var twitter = social.create({
site: 'Twitter',
consumerKey: 'XXXXXXXXXXXXXXXX',
consumerSecret: 'XXXXXXXXXXXXXXXXXXXXX'
});
shareButton.addEventListener('click', function() {
twitter.share({
message: 'Hello, world!',
success: function() {
alert('Tweeted!');
},
error: function(error) {
alert('Oh no! ' + error);
}
});
});
As Aaron answered on the Q&A, when using Social.js, you should not use a callback URL. The code itself will watch the web view for what it needs.

Google Analytics: I'm tracking Like button clicks, but how can I track clicks on the Page link?

I use ga_social_tracking.js to track Likes done via the Facebook Fan Box (HTML5).
That works fine, but I also want to track clicks on the link to the Page itself. I think many go to the Page and [i]then[/i] like the Page, instead of liking directly using the box...
How can I achieve this?
Using Jquery and Google custom event tracking you can do something like this:
$(document).ready(function(){
$('a').click(function(e){
link_url = $(this).attr('href');
recordOutboundLink(link_url, 'Title of event', 'Description of the event');
});
function recordOutboundLink(link, category, action) {
try {
var pageTracker = _gat._createTracker("{{google_analytics_code}}");
pageTracker._trackEvent(category, action);
} catch (err) { }
}
});

Facebook LIKE AppId or PageId

I am having an issue logging a "LIKE" for an application page. It seems that the like is not being inserted into the page_fan table. My concern is that I may be trying to LIKE the application page and not the actual page that contains the application as a tab. I have already written the LIKE code and the like does post to my wall etc. but when I perform the me() query against the page_fan table it does note return my uid.
I have tried the LIKE both within my custom page was well as the global LIKE above all canvas pages on FB page.
My question is: Should my code logic LIKE the ApplicationId(Canvas/iframe) or the PageId in which the Tab exists? Or I am totally off base with my logic.
Here is what I have developed and what I have found.
I have created applications that are accessible on the left hand side of a facebook page (tabs). These are canvas or iframe applications that generate a unique AppId when a new application is created.
For example, I am currently adding the AppId of a canvas page as an OG tag in same canvas iframe page.
I then access the following URL and select the page from an existing list that this tab should appear:
www.facebook.com/dialog/pagetab?app_id=111111111111111&display=popup&next=http://facebook.myapp.com/canvaspage.html
I wrote the following code to determine the page_id (for example this returned:222222222222222)
//App PageId
var url = 'https://graph.facebook.com/fql?q=SELECT url, id, type, site FROM object_url WHERE url="'+appURL+'"';
$.getJSON(url, function(data) {
$.each(data['data'], function(index, appPageId) {
if (appPageId) {
var appPageId = appPageId['id'];
}
});
});
<!-- Open Graph for the "PAGE" PagId that has a relationship to AppId (id:) below / I have found that this will include a likes variable if GT 0 -->
graph.facebook.com/222222222222222
{
"id": "222222222222222",
"name": "TEST APPLICATION",
"picture": "http://profile.ak.fbcdn.net/hprofile-ak-ash2/373257_225429330866626_1701496970_s.jpg",
"link": "http://apps.facebook.com/test-app/",
"app_id": 111111111111111, // Below ID - also the AppId
"category": "Website",
"description": "Test App Description",
"can_post": true
}
<!-- Open Graph for "APPLICATION" AppId --->
graph.facebook.com/111111111111111
{
"id": "111111111111111",
"name": "TEST APPLICATION",
"category": "Lifestyle",
"subcategory": "Food & Drink",
"link": "http://www.facebook.com/apps/application.php?id=111111111111111",
"canvas_name": "test-app",
"namespace": "test-app",
"icon_url": "http://static.ak.fbcdn.net/rsrc.php/v1/yT/r/4QVMqOjUhcd.gif",
"logo_url": "http://static.ak.fbcdn.net/rsrc.php/v1/yq/r/IobSBNz4FuT.gif",
"weekly_active_users": "2",
"monthly_active_users": "2"
}
Thanks in advance for your assistance.
You will want to like the Facebook page, not the app ID. Remember a facebook page can have many App Id's in it (what facebook calls Page tabs).

facebook javascript sdk not posting via ajax using fb.api and .post

I have a facebook application. The users are logged in and authorized. I am calling fb.api to post the user's name to my textfile. The alert shows the name. The post doesn't seem to post to my aspx file..
FB.Event.subscribe('edge.remove', function (href, widget) {
alert("outside");
FB.api('/me', function (response) {
alert(response.name);
var paramsObj = { 'name': response.name };
$.post("ajax/delete.aspx", paramsObj);
});
window.location.replace("Default.aspx");
});
I've updated my code to include showing the encapsulating facebook calls to give a broader picture as well as to include #Lix changes [thank you!].
Few things you might want to try :
Define your post parameters object before and only place the objects name in the jQuery $.post method.
Wrap your json keynames with quotes.
var paramsObj = { 'name':response.name};
$.post("ajax/write.aspx", paramsObj );
Use firebug/chrome developers tools to debug the AJAX request and see if any value is being passed and/or use breakpoints in your code to help you understand where the value is missing.
The page was being redirected prior to the api call/ajax post. This is what worked:
FB.Event.subscribe('edge.remove', function (href, widget) {
FB.api('/me', function (response) {
var paramsObj = { 'name': response.name };
$.post("ajax/delete.aspx", paramsObj);
window.location.replace("Default.aspx");
});
});