[TIMOB-18916] iOS: Posting a photo to Facebook gives "Unsupported FBRequest parameter type:TiBlob"
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-06-02T03:37:49.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 4.1.0, Release 4.0.1 |
Components | iOS |
Labels | n/a |
Reporter | Motiur Rahman |
Assignee | Chee Kiat Ng |
Created | 2015-05-19T12:16:33.000+0000 |
Updated | 2015-06-02T03:37:53.000+0000 |
Description
Post a Photo Using the Graph API from the Gallery or image in resources directory does not work on iOS always show this log info. [Community Question](https://community.appcelerator.com/topic/445/posting-a-photo-to-facebook-doesn-t-support-blobs-ios)
But It works on Android.
[INFO] : FBSDKLog: Unsupported FBRequest parameter type:TiBlob
[INFO] : -[TiBlob _fastCharacterContents]: unrecognized selector sent to instance 0x176261d0
*Testing Environments*
Operating System
Name = Mac OS X
Version = 10.9.5
Architecture = 64bit
Node.js
Node.js Version = 0.10.37
npm Version = 1.4.28
Titanium CLI
CLI Version = 4.0.0-beta8
Titanium SDK
SDK Version = 4.0.0.RC4
Target Platform = iphone
*Test Code*
var fb = require("facebook");
var win = Ti.UI.createWindow({
backgroundColor : '#FFFFFF',
});
fb.addEventListener('login', function(e) {
if (e.success) {
alert('Logged in');
}
});
fb.addEventListener('logout', function(e) {
alert('Logged out');
});
if (Ti.Platform.name === 'android') {
win.fbProxy = fb.createActivityWorker({
lifecycleContainer : win
});
}
// Add the button. Note that it doesn't need a click event listener.
win.add(fb.createLoginButton({
readPermissions : ['read_stream', 'email'],
top : 50
}));
var B2_TITLE = 'Upload Photo from file with Graph API';
var b2 = Ti.UI.createButton({
title : B2_TITLE,
left : 10,
right : 10,
top : 200,
height : 80
});
win.add(b2);
b2.addEventListener('click', function() {
b2.title = 'Uploading Photo...';
var f = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, 'KS_nav_ui.png');
var blob = f.read();
var data = {
caption : 'behold, a flower',
picture : blob
};
fb.requestNewPublishPermissions(['publish_actions', 'read_stream', 'user_hometown'], fb.AUDIENCE_FRIENDS, function(e) {
if (e.success) {
Ti.API.info('Permissions:' + fb.permissions);
fb.requestWithGraphPath('me/photos', data, "POST", function(outcome) {
alert("Posted! Photo Posted To Your Page");
});
}
if (e.error) {
Ti.API.info('Publish permission error');
}
if (e.cancelled) {
Ti.API.info('Publish permission cancelled');
}
});
});
win.open();
Thanks.
[~penrique] Can you please look at this ASAP to see if anything stands out to you?
PR Here: https://github.com/appcelerator-modules/ti.facebook/pull/18
Facebook binary update in Titanium mobile. PR for 4_0_X: https://github.com/appcelerator/titanium_mobile/pull/6883 PR for master: https://github.com/appcelerator/titanium_mobile/pull/6882
Verified fixed using: MacOS 10.10.3 Studio 4.0.0.201505202026 Ti SDK 4.0.1.v20150529014212 Appc NPM 4.0.0 Appc CLI 4.0.1-rc Ti CLI 4.0.1-rc Alloy 1.6.0 Node v0.10.37 Java 1.7.0_45 Facebook Module 4.0.4 I am able to login and post photos with the Graph API (using the above sample code) without error.