Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

post screenshot to facebook
Started by mmk.verheijden Dec 16 2013 04:13 PM

- - - - -
38 replies to this topic
[TOPIC CONTROLS]
Page 2 of 2 1 2
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#26

mmk.verheijden

[GLOBAL: userInfoPane.html]
mmk.verheijden
  • Contributor

  • 203 posts
  • Corona SDK

Hi g I can confirm that system.DocumentsDirectory work for reading and writing as it works on all my apps

[TOPIC: post.html]
#27

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,676 posts
  • Enterprise

You have an error:

 

I/Corona ( 8087): File does not exist: ueue.png

 

I don't know what ueue.png is, I don't see it in your source code.  I suspect that you have an error selecting the filename and passing it to the function.  You should look at your functions you are using to create files in system.DocumentsDirectory and how you get those files there.  You need to look at your code that's generating the filename to make sure it's doing what you expect it to do.  You can use the "print" API to print out values to the console log and then you can look in that log to see what the values are.



[TOPIC: post.html]
#28

Savarok

[GLOBAL: userInfoPane.html]
Savarok
  • Enthusiast

  • 54 posts
  • Enterprise

Hi Salvador, I got this to work I'm my games will post some more information/code tomorrow, I the mean time you need to check the keyhash your using if it's on a Android


Ps I didn't realise you can use the link asset... Try it without the link (or add a correct url) see if it works

--link = "http://roedangames.net"

 

Still having the same response. have ensured my Facebook settings are as per what they should be. 

 

Here is what I have.

 

FB-Settings.png

 

Code.png

 

unsure Rob and mmk as to why this issue is still ongoing, It appears the file is going into the system.DocumentsDirectory correctly but still not working.

 

I have enabled "Native or desktop app?" in Facebook and disabled it with the same response. 



[TOPIC: post.html]
#29

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,676 posts
  • Enterprise

In the screen shot above, you show a folder called Documents.  Is this your Corona SDK simulator sandbox?  It's not the same folder as the Xcode simulator sandbox.



[TOPIC: post.html]
#30

Savarok

[GLOBAL: userInfoPane.html]
Savarok
  • Enthusiast

  • 54 posts
  • Enterprise

In the screen shot above, you show a folder called Documents.  Is this your Corona SDK simulator sandbox?  It's not the same folder as the Xcode simulator sandbox.

 

I accessed my /Users/danny_roerring/Library/Application Support/iPhone Simulator/7.1/Applications/2F58DD96-66B8-4D72-81B9-9354B15C80CB/BeetleJuice.app/BeetleJuice 

 

which I suspect is my Xcode Simulator Sandbox can can see 

 

 

Attached Thumbnails

  • Screenshot 2014-06-07 12.24.29.png


[TOPIC: post.html]
#31

gigio76

[GLOBAL: userInfoPane.html]
gigio76
  • Enthusiast

  • 33 posts
  • Enterprise

Good catch the missing ueue.png into log.

It also is missing in the code because I changed some names before posting it, in order to make it more readable, that's why they don't match.

Anyway, the log says the image is missing and this is a fact. Now I should understand why!

 

thanks,



[TOPIC: post.html]
#32

gigio76

[GLOBAL: userInfoPane.html]
gigio76
  • Enthusiast

  • 33 posts
  • Enterprise

I rewrote everything and I add the functionality of screenshot saving and -- EVERYTHING WORKS!

I don't really know what did not work before and I am investigating about it.

Thanks to everybody!

 

g



[TOPIC: post.html]
#33

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,676 posts
  • Enterprise

@Savorok, what messages are you getting in your console log?  For the Xcode simulator you have to run the "Console" app to see it.



[TOPIC: post.html]
#34

Savarok

[GLOBAL: userInfoPane.html]
Savarok
  • Enthusiast

  • 54 posts
  • Enterprise

@Savorok, what messages are you getting in your console log?  For the Xcode simulator you have to run the "Console" app to see it.

 

Hopefully I have done this right but here is the output attached (XCode.png)

 

Quick Note:

 

1. Dose the application on Facebook need to be out of Developer mode or could that be causing it?

 

I checked and created a Test app within the Facebook portal and when using the app ID I get the following also attached (Example.png)

 

 

Attached Thumbnails

  • XCode.png
  • Example.png
  • DeveloperMode.png


[TOPIC: post.html]
#35

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,676 posts
  • Enterprise

It looks to me like there is an issue with GameThrive based on what I could see.  Normally people will use their mouse and highlight the text in Xcode's Organizer window and then do a Copy (CMD-C) and then come here and paste it in (CMD-V).  It's really hard to make out what's going on when you just screen shot the screen.

 

Perhaps you should consider asking this in the GameThrive sub-forum since the error seems related to them.

 

Rob



[TOPIC: post.html]
#36

Savarok

[GLOBAL: userInfoPane.html]
Savarok
  • Enthusiast

  • 54 posts
  • Enterprise

It looks to me like there is an issue with GameThrive based on what I could see.  Normally people will use their mouse and highlight the text in Xcode's Organizer window and then do a Copy (CMD-C) and then come here and paste it in (CMD-V).  It's really hard to make out what's going on when you just screen shot the screen.

 

Perhaps you should consider asking this in the GameThrive sub-forum since the error seems related to them.

 

Rob

 

My apologies Rob I thought a screenshot might have been easier. Ignore the GameThrive it's fully working so unsure as to why its generating this error but that's another problem.

 

The image appears to be appearing in my "documents" directory. Renamed it to start with a lower case "f" to check this and worked fine so this cannot be the problem. Maybe you might be able to see something on the log that I cannot see. 

Jun  8 23:19:38 Dannys-MacBook-Pro.local SimulatorBridge[12203] <Warning>: Application launched after 0.00 seconds.
Jun  8 23:19:39 Dannys-MacBook-Pro.local backboardd[12191] <Error>: HID: The 'Passive' connection 'BeetleJuice' access to protected services is denied.
Jun  8 23:19:39 Dannys-MacBook-Pro.local BeetleJuice[14434] <Warning>: Platform: iPhone Simulator / x86_64 / 7.1 / Apple Software Renderer / OpenGL ES 2.0 APPLE-9.4.3
Jun  8 23:19:39 Dannys-MacBook-Pro.local SpringBoard[12200] <Warning>: Remote notifications are not supported in the simulator
Jun  8 23:19:39 Dannys-MacBook-Pro.local BeetleJuice[14434] <Warning>: Facebook Credits: false
Jun  8 23:19:39 Dannys-MacBook-Pro.local BeetleJuice[14434] <Warning>: Twitter Credits:  true
Jun  8 23:19:39 Dannys-MacBook-Pro.local BeetleJuice[14434] <Warning>: AppDelegate.mm: didFailToRegisterForRemoteNotificationsWithError: remote notifications are not supported in the simulator
Jun  8 23:19:39 Dannys-MacBook-Pro.local BeetleJuice[14434] <Warning>: Runtime error
	/Users/hiptic/Documents/GameThrive/SDK/Corona/SDK/shared/plugin_GameThrivePushNotifications.lua:292: attempt to concatenate field 'token' (a nil value)
	stack traceback:
		/Users/hiptic/Documents/GameThrive/SDK/Corona/SDK/shared/plugin_GameThrivePushNotifications.lua:292: in function </Users/hiptic/Documents/GameThrive/SDK/Corona/SDK/shared/plugin_GameThrivePushNotifications.lua:270>
		?: in function <?:218>
Jun  8 23:19:50 Dannys-MacBook-Pro.local BeetleJuice[14434] <Warning>: Registration Successful
Jun  8 23:20:04 Dannys-MacBook-Pro.local BeetleJuice[14434] <Warning>: WARNING: gameNetwork.init() was already called for gamecenter.


Edit: The above is with changing my file copy code to the following aswell, but like I said I can confirm the image is copied correctly.

 

--Read the exiciting FaceBookIcon from the resource directory (image is in same drector as my main.lua and other files)
--Read image and convert image to a binary form
local pathRead = system.pathForFile( "FaceBookIcon.jpg",system.ResourceDirectory )
local file = io.open( pathRead, "rb" )
local imageData = file:read( "*a" )
io.close( file )
--Setup write directory to my documesnts directoy that my settings have been saved to
--Write the binary file and close and set FileStream back to nil
local pathWrite = system.pathForFile( "faceBookIcon.jpg", system.DocumentsDirectory )
local file = io.open( pathWrite, "wb" )
file:write( imageData )
io.close( file )
file = nil

 

EDIT: This works fine "facebook.request( "me/feed", "POST", { message="Hello Facebook" } )" so it appears its defiantly picture related. 


Edited by Savarok, 08 June 2014 - 05:41 AM.


[TOPIC: post.html]
#37

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,676 posts
  • Enterprise

You have an error coming from GameThrive:

 

Jun 8 23:19:39 Dannys-MacBook-Pro.local BeetleJuice[14434] <Warning>: Runtime error

    /Users/hiptic/Documents/GameThrive/SDK/Corona/SDK/shared/plugin_GameThrivePushNotifications.lua:292: attempt to concatenate field 'token' (a nil value)

    stack traceback:

        /Users/hiptic/Documents/GameThrive/SDK/Corona/SDK/shared/plugin_GameThrivePushNotifications.lua:292: in function </Users/hiptic/Documents/GameThrive/SDK/Corona/SDK/shared/plugin_GameThrivePushNotifications.lua:270>

        ?: in function <?:218>

 

The only difference I see in  your code and code I've tested multiple times that works is you're providing a link and that may be causing your problem.  Link is not a valid option for "me/photos".  See:

 

https://developers.facebook.com/docs/graph-api/reference/v2.0/user/photos



[TOPIC: post.html]
#38

george18

[GLOBAL: userInfoPane.html]
george18
  • Contributor

  • 233 posts
  • Corona SDK

GameThrive dev here -- That error normally happens because your iOS provisioning profile does not have push permissions on it, but in this case it's probably happening because push notifications aren't available on the simulator.

 

For either case, we'll be releasing an update soon to have a better message displayed when this error is encountered.

 

The error happens in a callback, so it shouldn't have any effect on other parts of your app.

 

It's possible this error is because you are using an invalid permission name. Here's what Facebook says about "publish_stream":

 

Facebook used to have a permission called publish_streampublish_actions replaces it in all cases. This permission also replaces photo_upload.

(https://developers.facebook.com/docs/facebook-login/permissions/v2.0)

 

 

So basically, you should replace publish_stream with publish_actions. Also, this permission now requires approval by Facebook to use. But hopefully it should still work in development mode without any special approval.



[TOPIC: post.html]
#39

george18

[GLOBAL: userInfoPane.html]
george18
  • Contributor

  • 233 posts
  • Corona SDK

Updated my previous post with a bunch of new info. Replying again to notify people subscribed to this thread. 




[topic_controls]
Page 2 of 2 1 2
 
[/topic_controls]