Discussion in 'iOS Development' started by prime31, Sep 19, 2010.
@sam, just drag the image into your Xcode project and it will be included in your app bundle.
Oh, thanks! But then when I do a "replace" build in Unity it will stomp that, won't it?
@sam, yup. You could use StreamingAssets as well. Check the Unity docs for the details.
Ahh thanks very much for your help. I'll use StreamingAssets.
@sam - Glad to hear you've got it working- could you post the version of your facebook app please?
Does anyone know how to logout completely on iPad?
When I login and go back to the beginning (logout is called) and want to login again with an other account, I'm still logged in with the first account.
If I don't use logout(), my iPad doesn't open safari webbrowser the next time I want to login.
It's like you say to the app you are logged out, but not to the browser.
I used login with extended permission to get the users email address.
I hope someone can help me with this.
Thanks in advance.
@Deoxyz, I believe I responded to your email already. The Facebook logout method has no control over Mobile Safari. It sounds like what you need to do is turn off cookies and remembering passwords in Mobile Safaris settings.
@Prime - My previous issue with logging in via the Facebook App is now solved, all working perfectly!
I don't know if this is a result of your bug report or some other fb activity- but either way, thank you for the quick response
I have a problem. When I login with permits (email) and do a custom request, as a result I get mail in a format firstname.lastname@example.org, but I need direct email for registration in my app. Any suggestion?
@nick, you will have to check with Facebook for that. I have no idea if it is possible to not get a proxy email.
I found what the problem and trying to solve it. Thanks for the answer!
The server returns email in "email@example.com" format. And I need to decode this string. System.Web.HttpUtility is unavailable and I don't know, how I can decode this string.
Am I doing something wrong here? All logged in to Twitter. I'm trying to get a list of followers for the logged in user.
Dictionary<string, string> dic = new Dictionary<string, string>();
TwitterBinding.performRequest("GET", "/statuses/followers.json", dic);
I get the message saying it's successful however if I check the size of the Dictionary it's 0. There are definitely followers on the logged in account.
Thanks in advance
@griffeth, check out the demo scene and how it handles requests. Anything that requires a round trip to the server doesn't return anything because it takes time to get the data. Events are used to signal when the data is ready.
Anyone figured out the proper settings to use for Facebook? we are having issues with the plugin as well.
UPDATE: Never mind, I did more test using the new auth login, it looks pretty cool (icon support and all). Now everything seems to work.
Cheers - nailed it
I looked around but couldn't find this out - so if I log in with my account into my twitter app and do a custom request it's fine. However if one of my friends tries to log in (After I log out or after restarting the app) I get the error
error: This method requires authentication.
If anyone has seen this before please let me know. It's weird that it's fine if I try and not if the others do (using the oauth method)
Never mind, it seems like it just takes a while to start working for some reason
With the twitter plugin, Ok I feel like there's an issue or I'm not understanding something. When I start the app and log in, I get the successful login callback and everything work fine. If I then log out and log in with someone else's account (with oauth both times) when I request anything I get "could not authorize" until I close and open the App again which proceeds to fix it.
@Griffith, iOS devices are inherently single user devices so little things like this pop up when trying to go multiuser. What is most likely happening is that the webview is caching some cookies that aren't purged until app shutdown.
Ok I'll see what I can do
I'm not following. How can I make an app request with the graph api? Also, I *believe* with the just released facebook iOS stuff there should now be facebook supplied views you can use.
@ThanNewell, which part are you not following? The Graph API covers getting the raw data. If you want to use a Facebook provided view there is a showDialog method available that lets you pass in the custom dialog type and params.
message: 'My app request message',
title: 'My app request title',
This will send an app request to some_user_id. I just need something similar on the iOS. It sounds like you are suggestion I don't use the plugin at all and open a browser? Is this sort of thing not something exposed in the facebook C# sdk?
@Newell, the Facebook JS API and the native Facebook Connect are two fundamentally different SDKs. I am not familiar with the JS SDK and there is nothing in the native SDK specifically called "apprequest". The native SDK revolves mostly around the Graph API. You will want to focus your search in the native SDK docs and the Graph API to see if Facebook exposes what you need to native code.
It looks like app requests can sorta be done with a graph API call.
The code I have that seems to do the trick:
Hashtable graphParams = new Hashtable();
graphParams.Add( "Message", "Come play my app!" );
graphParams.Add( "title", "Invite your friends!" );
graphParams.Add( "to", sendToFBUserID );
FacebookBinding.graphRequest( "/me/apprequests", "POST", graphParams );
Edit 1: Unfortunately, the response I get back is, "Unsupported method, apprequests". Since I can't get back the ID, I can't delete it from the server... so this isn't a real option.
Edit 2: Passing in the access token gave me back a valid request ID. Huzzah!
Apologies if this has already been answered, but are there any plans in the pipeline for a twitter/facebook plugin using iOS5's new social networking integration?
@unitybro, iOS 5 has no Facebook integration and we already have a Social Networking Plugin that has both integrated. At some point, once iOS 5 adoption is enough we will add support for the tweet sheet as well.
Hello! I'm trying to upload an image to Twitter with a message although I'm getting this error in Xcode;
image file does not exist at path: http://www.robotroadies.com/1.jpg
Would it be better to save the file in the app itself as I already have it saved but I wasn't sure on what the string's format should be to reference it. Some thing like "Assets/images/image1"?
Here is the code I'm using;
twitterMessage = GUI.TextArea (Rect (Screen.width*0.227, Screen.height*0.241, width, buttonHeight*3-10), twitterMessage, Screen.height*0.21875);
if( GUI.Button( new Rect(/*218+(width*0.1666)*/Screen.width*0.2083, Screen.height*0.4719, width*0.6, buttonHeight), "Post Status Update") )
TwitterBinding.postStatusUpdate( twitterMessage , "http://www.robotroadies.com/1.jpg");
@jason, the image has to be stored on the device. A local path to the image is required. Check out the demo scene for an example.
I have problem with the facebook part of the plugin. It worked a few days ago but recently, when I log into the app and try to get an access token through FacebookBinding.login, i get an error "Cannot open page, Safari cannot open the page because the address is invalid". Does anyone know how to solve this?
I'm not sure if this is related to the login problem found two pages ago.
@John, double check your plist setup and be sure to delete the app from your device between tests.
I am having som problems with the social plugin for iOS. I wrote a question for it here:
It seems i cant login when using the facebook app on the device, but if i remove the app it works fine. Any pointers?
@Niklas, it sounds like you may have rejected the login at some point while testing. You may have luck going to the Facebook website in your user account and digging through their permissions. Find your app in there and just remove anything you find to get a fresh start.
All of a sudden today, my request to friends/ids now returns a hash table instead of array list and the data I get back seems to be incorrect.
I get no ids and just these lines :/ quite strange considering yesterday it was fine. Anyone else experience this? (thinking it's more of a twitter api issue than the plugin though )
@Griffith, there was a change that went live on Twitters servers yesterday. Check their dev portal or Google Group for the details. If I recall it has something to do with passing the cursor to the method.
We intend on uploading the binary to our game shortly, however I was doing some last minute checking on what might get the app rejected and found this blog post: http://gtproductions.net/blog/ways-to-get-rejected-by-apple-app-store-tips/ (although it is from 2009 so Apple's requirements may be different now?)
It mentions that an app can be rejected for not notifying a user that there info will be sent over a network and I was wondering whether this has affected anyone when they try and log in or post messages with the functions available in this plugin. And whether it's made anyone's apps get rejected.
Here's the text from the site I'm on about;
14.) Handling user data
If you collect user information and the data is sent over a network, you need to explain to the user what will happen to their data and give them an option to opt out. For example, leaderboards require certain notification to the user that even their bogus name used on the high score boards will be sent over the internet and seen by others.
Prime do you know anything about this?
@jasonh, I have never seen an app rejected for this nor have I seen any app notify me that it was going to send data out. I wouldn't worry much about it.
Hi, sorry for newbie question. Just bought your social networking plugins yesterday. So the problem is like this :
1. I build the apps from unity3D ver 3.4.1f5
2. A dialogbox came up "SocialNetworking Unity support successfully integrated!
3. I run xcode ver 4.0.2 and plug my iphone and run the apps from xcode
4. when the xcode build the apps ... I got an error message :
What should I do ? Where am I doing wrong ? thx
@petero, assuming you are building against iOS 5 I would suggest closing Xcode completely and doing a Build followed by Replace from Unity. It looks like you may have just gotten a bad build.
@prime31, am I need to upgrade to iOS5? I have close the xcode and delete all file inside and build from the beginning. And the error message still the same. I am using Unity3D indie for iOS version, and below this is my xcode and unity3d version.
unity3D ver 3.4.1f5
xcode ver 4.0.2
Please help .... thx
@petero, you are using an old version of the iOS SDK. You must build against iOS 5.
I just tried to import the Social Network package into my project and there's a problem with there being 2 MiniJSON files. Deleting the one in the social network plugin causes the compiler to complain that MiniJSON does not contain a definition for 'jsonDecode', deleting the one in the UIToolkit plugin causes the compiler to complain that there's no definition for 'JsonDecode'. The difference being lower case j and upper case J.
Presumably the latest version of UIToolkit has been updated to conform to your lower case methods. Unfortunately it's far too late for me to just update UIToolkit for this project, i've made numerous changes and i dread to think of all the things that would break if i do an update now.
All my attempts of converting either plugin produce more errors that I just dont' understand.
What do you suggest I do?
@Matkins, you have an old version of UIToolkit for sure. The easiest path to fix things is to delete the UIToolkit MiniJson.cs file and leave the Social Networking one. There will just be a copule minor compilation errors left and they are easily fixed by changing the capital 'J' to lowercase 'j' (MiniJson.jsonEncode/Decode).
Ok, it wasn't as painful as I feared. All sorted, Cheers.
I've been using the SocialNetworking plugin for a while, but as I was out of date with three of the plugins (last updated August) I thought I'd be "tidy" and start over with the plugins, and import them from scratch.
I'm now getting the following exception in XCode as soon as the plugin is referenced in code...
2011-11-08 18:50:43.608 testapp[9795:707] -[Facebook initWithAppId:andDelegate:]: unrecognized selector sent to instance 0x7a5c330
2011-11-08 18:50:43.630 testapp[9795:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Facebook initWithAppId:andDelegate:]: unrecognized selector sent to instance 0x7a5c330'
I have of course re-attached the SocialNetworkingManager prefab to the scene, added the Facebook app ID into the Info.plist Additions, chmod +x'd the PostprocessBuildPlayer scripts (as recommended by the Plugin Troubleshooter) and output to a fresh (replaced) XCode build folder, but no luck as yet.
I'm sure I've just forgotten something silly - any ideas?
@DarkJedi, it looks like you still have some old files hanging around in there. Be sure to do a Build followed by Replace to get a fresh Xcode project. It is often a good idea to do a Product -> Clean when large changes are present as well to clear out the object cache in Xcode.
Starting over a second time with the plugins, hosing the build directory (not just replace), running an XCode clean and shouting at the screen seems to have resolved it, and I'm up and running again
For others with similar symptoms, I think shouting at the screen is what fixed it.
Hey Prime, back to the issue I was having about people logging out etc. It seems that even if it's the first login for anyone, the App has to be restarted before it can do anything that requires authorisation.
For example if someone buys the app and logs in they will have to restart the App before my requests work.
Any ideas if this is something I'm doing wrong? I've seen other games that don't require a restart. There's no log out call made it's just the first time login.
(Oh btw it's a twitter login not facebook)
@Griffith, are you seeing that behavior with the demo scene? I can't reproduce it on my end.