Native email and Twitter image attachment doesn't work when live

Hi!

I have 2 exactly the same versions of my app on my iPhone. One is in the app store version the other a developer build.

On the app store version images do not get attached on an email or Tweet, on the dev build they do.

Should the baseDir or filename path be different?

local options = {                     message = "Hi this is my Tweet",                     image = {                         { baseDir=system.ResourceDirectory, filename="images/Twitter\_image.png"},                     }                 } native.showPopup( "twitter", options )

local options = { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; subject = "bla", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; isBodyHtml = true, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; body = "\<html\>\<body\>\<p\>Hi\</p\>\</body\>\</html\>", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; attachment = { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { baseDir=system.ResourceDirectory, filename="images/email\_image.png", type="image" }, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } native.showPopup( "mail", options )

On 1217 this still does not work when using the Apple appstore version, but it does work on developer builds. Tested on iOS6 and iOS7.

Twitter with an image attached from the app root directory:

local options = { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; message = "Hi this is my Tweet", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; image = { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { baseDir=system.ResourceDirectory, filename="Twitter\_image.png"}, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } native.showPopup( "twitter", options )

or email with an image attached:

local options = { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; subject = "bla", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; isBodyHtml = true, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; body = "\<html\>\<body\>\<p\>Hi\</p\>\</body\>\</html\>", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; attachment = { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { baseDir=system.ResourceDirectory, filename="email\_image.png", type="image" }, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } native.showPopup( "mail", options )

There should be nothing that a deployed version would do differently than a developer version.  Have you tried building an AdHoc version and installing it instead of against a developer provisioning profile?  What bundle ID is your developer version using? 

Can you attach your device to XCode and look at the console log using XCode’s organizer and see if you’re getting any errors?

system.ResourceDirectory should be readable for this.  Are your images really named that or are we running into some case sensitivity issue?

I am not sure what you mean with the profile, I just build with a development profisioning profile to try it out, and it works.

I am using the exact code as in http://docs.coronalabs.com/daily/api/library/native/showPopup.html

There is no error with the imagename or case sensivity stuff, it works on development. And I tried different image names, now it is “emailImage.png”.

Below the Xcode messages, when using Twitter, on email there are no Xcode messages.

Development profisioning profile version (attachment does get inserted in Tweet):

Oct 13 11:50:53 iPhone-xxxxxx SocialUIService[1752] \<Notice\>: 2013-10-13 11:50:53.832|SocialUIService|0x14ebaa40: The connection to com.apple.twitter.xpc was invalidated. Oct 13 11:50:53 iPhone-xxxxxx WordnRoll[1736] \<Notice\>: 2013-10-13 11:50:53.850|WordnRoll|0x14d2da30: ERROR: View service did terminate with error Error Domain=\_UIViewServiceErrorDomain Code=1 "The operation couldn’t be completed. (\_UIViewServiceErrorDomain error 1.)" Oct 13 11:50:56 iPhone-xxxxxx com.apple.twitter.xpc[1753] \<Notice\>: 2013-10-13 11:50:56.256|com.apple.twitte|0x15ddc470: Unable to get entitlement 'com.apple.private.social.twitter.service' Oct 13 11:50:56 iPhone-xxxxxx com.apple.twitter.xpc[1753] \<Notice\>: 2013-10-13 11:50:56.273|com.apple.twitte|0x15ddc470: New remote session: \<TWDSession: 0x15ea84f0\> Oct 13 11:50:57 iPhone-xxxxxx com.apple.twitter.xpc[1753] \<Error\>: TASK-ASSERT: cfurlcache - ProcessCacheTask - FAILED to get task-assertion, going commando with 1 items to process.

Distributed version from Apple Appstore (attachment does not get inserted in Tweet) :

Oct 13 11:51:56 iPhone-xxxxxx SocialUIService[1752] \<Notice\>: 2013-10-13 11:51:56.663|SocialUIService|0x14daef10: The connection to com.apple.twitter.xpc was invalidated. Oct 13 12:29:19 iPhone-xxxxxx kernel[0] \<Debug\>: 183269.263434 wlan.A[30910] AppleBCMWLANNetManager::checkRealTimeTraffic(): now 183269.263424166 num entries 4 Oct 13 12:29:19 iPhone-xxxxxx kernel[0] \<Debug\>: 183269.263460 wlan.A[30911] AppleBCMWLANCore::dumpWmeCounters(): per TIDs tx counters: 458809 67746 0 0 0 17845 14627 0, per TIDs rx counters: 525296 183762 14260 0 12727 0 1308 60 Oct 13 12:29:19 iPhone-xxxxxx kernel[0] \<Debug\>: 183269.263481 wlan.A[30912] AppleBCMWLANCore::dumpWmeCounters(): AWDL: Tx 10 0 0 0 0 0 0 0, Rx: 16 0 0 0 0 0 0 0 Oct 13 12:29:19 iPhone-xxxxxx com.apple.twitter.xpc[1753] \<Notice\>: 2013-10-13 12:29:19.395|com.apple.twitte|0x15ea9560: Unable to get entitlement 'com.apple.private.social.twitter.service' Oct 13 12:29:19 iPhone-xxxxxx com.apple.twitter.xpc[1753] \<Notice\>: 2013-10-13 12:29:19.432|com.apple.twitte|0x15ea9560: New remote session: \<TWDSession: 0x15e5db40\> Oct 13 12:29:19 iPhone-xxxxxx kbd[125] \<Warning\>: -[PFUbiquitySwitchboardEntryMetadata setUseLocalStorage:](754): CoreData: Ubiquity: mobile~0C4B4246-4F51-5414-8EA6-DA9DEADAD66C:UserDictionary Using local storage: 1 Oct 13 12:29:20 iPhone-xxxxxx kbd[125] \<Warning\>: -[PFUbiquitySwitchboardEntryMetadata setUseLocalStorage:](754): CoreData: Ubiquity: mobile~0C4B4246-4F51-5414-8EA6-DA9DEADAD66C:UserDictionary Using local storage: 0 Oct 13 12:29:20 iPhone-xxxxxx com.apple.twitter.xpc[1753] \<Error\>: TASK-ASSERT: cfurlcache - ProcessCacheTask - FAILED to get task-assertion, going commando with 1 items to process.

On 1217 this still does not work when using the Apple appstore version, but it does work on developer builds. Tested on iOS6 and iOS7.

Twitter with an image attached from the app root directory:

local options = { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; message = "Hi this is my Tweet", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; image = { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { baseDir=system.ResourceDirectory, filename="Twitter\_image.png"}, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } native.showPopup( "twitter", options )

or email with an image attached:

local options = { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; subject = "bla", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; isBodyHtml = true, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; body = "\<html\>\<body\>\<p\>Hi\</p\>\</body\>\</html\>", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; attachment = { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { baseDir=system.ResourceDirectory, filename="email\_image.png", type="image" }, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } native.showPopup( "mail", options )

There should be nothing that a deployed version would do differently than a developer version.  Have you tried building an AdHoc version and installing it instead of against a developer provisioning profile?  What bundle ID is your developer version using? 

Can you attach your device to XCode and look at the console log using XCode’s organizer and see if you’re getting any errors?

system.ResourceDirectory should be readable for this.  Are your images really named that or are we running into some case sensitivity issue?

I am not sure what you mean with the profile, I just build with a development profisioning profile to try it out, and it works.

I am using the exact code as in http://docs.coronalabs.com/daily/api/library/native/showPopup.html

There is no error with the imagename or case sensivity stuff, it works on development. And I tried different image names, now it is “emailImage.png”.

Below the Xcode messages, when using Twitter, on email there are no Xcode messages.

Development profisioning profile version (attachment does get inserted in Tweet):

Oct 13 11:50:53 iPhone-xxxxxx SocialUIService[1752] \<Notice\>: 2013-10-13 11:50:53.832|SocialUIService|0x14ebaa40: The connection to com.apple.twitter.xpc was invalidated. Oct 13 11:50:53 iPhone-xxxxxx WordnRoll[1736] \<Notice\>: 2013-10-13 11:50:53.850|WordnRoll|0x14d2da30: ERROR: View service did terminate with error Error Domain=\_UIViewServiceErrorDomain Code=1 "The operation couldn’t be completed. (\_UIViewServiceErrorDomain error 1.)" Oct 13 11:50:56 iPhone-xxxxxx com.apple.twitter.xpc[1753] \<Notice\>: 2013-10-13 11:50:56.256|com.apple.twitte|0x15ddc470: Unable to get entitlement 'com.apple.private.social.twitter.service' Oct 13 11:50:56 iPhone-xxxxxx com.apple.twitter.xpc[1753] \<Notice\>: 2013-10-13 11:50:56.273|com.apple.twitte|0x15ddc470: New remote session: \<TWDSession: 0x15ea84f0\> Oct 13 11:50:57 iPhone-xxxxxx com.apple.twitter.xpc[1753] \<Error\>: TASK-ASSERT: cfurlcache - ProcessCacheTask - FAILED to get task-assertion, going commando with 1 items to process.

Distributed version from Apple Appstore (attachment does not get inserted in Tweet) :

Oct 13 11:51:56 iPhone-xxxxxx SocialUIService[1752] \<Notice\>: 2013-10-13 11:51:56.663|SocialUIService|0x14daef10: The connection to com.apple.twitter.xpc was invalidated. Oct 13 12:29:19 iPhone-xxxxxx kernel[0] \<Debug\>: 183269.263434 wlan.A[30910] AppleBCMWLANNetManager::checkRealTimeTraffic(): now 183269.263424166 num entries 4 Oct 13 12:29:19 iPhone-xxxxxx kernel[0] \<Debug\>: 183269.263460 wlan.A[30911] AppleBCMWLANCore::dumpWmeCounters(): per TIDs tx counters: 458809 67746 0 0 0 17845 14627 0, per TIDs rx counters: 525296 183762 14260 0 12727 0 1308 60 Oct 13 12:29:19 iPhone-xxxxxx kernel[0] \<Debug\>: 183269.263481 wlan.A[30912] AppleBCMWLANCore::dumpWmeCounters(): AWDL: Tx 10 0 0 0 0 0 0 0, Rx: 16 0 0 0 0 0 0 0 Oct 13 12:29:19 iPhone-xxxxxx com.apple.twitter.xpc[1753] \<Notice\>: 2013-10-13 12:29:19.395|com.apple.twitte|0x15ea9560: Unable to get entitlement 'com.apple.private.social.twitter.service' Oct 13 12:29:19 iPhone-xxxxxx com.apple.twitter.xpc[1753] \<Notice\>: 2013-10-13 12:29:19.432|com.apple.twitte|0x15ea9560: New remote session: \<TWDSession: 0x15e5db40\> Oct 13 12:29:19 iPhone-xxxxxx kbd[125] \<Warning\>: -[PFUbiquitySwitchboardEntryMetadata setUseLocalStorage:](754): CoreData: Ubiquity: mobile~0C4B4246-4F51-5414-8EA6-DA9DEADAD66C:UserDictionary Using local storage: 1 Oct 13 12:29:20 iPhone-xxxxxx kbd[125] \<Warning\>: -[PFUbiquitySwitchboardEntryMetadata setUseLocalStorage:](754): CoreData: Ubiquity: mobile~0C4B4246-4F51-5414-8EA6-DA9DEADAD66C:UserDictionary Using local storage: 0 Oct 13 12:29:20 iPhone-xxxxxx com.apple.twitter.xpc[1753] \<Error\>: TASK-ASSERT: cfurlcache - ProcessCacheTask - FAILED to get task-assertion, going commando with 1 items to process.