No share pop-up on IOS possible like on Android and the Notes IOS app?

On Android, I use native.showPopup(“social”,options), and the social network/SMS/Mail selector pops up as normal. The URL to be shared is passed in options.

Built-in IOS apps seem to have a similar social network selector popup, but this selector seems unavailable in unavailable to third-party apps, either for all frameworks or just the Corona framework.

Currently I handle this by allowing only Facebook on IOS, which is a compromise that I would like removed.

Here’s the code I use:
 

shareFacebook=function(msg,picfname,picdir,url2)local serviceName = "facebook" local isAvailable = true --default for IOS, do not ask if \_MODEL=="Android" then isAvailable=native.canShowPopup( "social", serviceName ) end if ( isAvailable ) then local listener = {} function listener:popup( event ) dprint( "name: " .. event.name ) dprint( "type: " .. event.type ) dprint( "action: " .. tostring( event.action ) ) dprint( "limitReached: " .. tostring( event.limitReached ) ) end native.showPopup( "social", { service = serviceName, listener = listener, url = url2 }) else native.showAlert( "Kan inte skicka " .. serviceName .. "-meddelande!", "Om du har Facebookappen, kontrollera att du är inloggad under Inställningar \> Facebook \> Konto för att kunna dela.", { "OK" } ) end end

Question: I could make a pop-up selector for the networks Corona supports, but is there a way to trigger the IOS selector?

You should use the “activity” plugin (which is part of native.showPopup()) which is the iOS way of accessing email, SMS, and social networks. The “social” plugin really just works for Android.

Rob

The activity plugin is not documented, and I didn’t find anything substantial from a web search, a search on this forum or in the SDK code examples. Should the below guessed code work? Just substitute “social” for “activity” on IOS? It gives the attached screenshot in the IOS Simulator.

I expected to see some options there for IOS apps, but there are none. Is the reason that none of them is set up? Unfortunately I don’t have a test device available at the moment.

shareMsgUrl=function(msg,url) local popupType="social" if \_MODEL~="Android" then popupType="activity" end  isAvailable=native.canShowPopup( popupType ) if (isAvailable) then local listener = {} function listener:popup( event ) dprint( "name: " .. event.name ) dprint( "type: " .. event.type ) dprint( "action: " .. tostring( event.action ) ) dprint( "limitReached: " .. tostring( event.limitReached ) ) end native.showPopup( popupType, { listener = listener, url = url }) else native.showAlert( "Sharing error", "Sharing unavailable!", { "OK" } ) end end

Thanks,
Henrik.

Edit: The above code does not work. It gives the same result as in the Simulator on an Iphone with IOS 11, and Facebook and Mail installed and configured. I.e. the network selector is not populated with social network icons.

Simulator%20Screen%20Shot%2020%20Dec%202
 

The documentation is here:  https://docs.coronalabs.com/plugin/CoronaProvider_native_popup_activity/index.html

It’s in the Utility category instead of Social.

Rob

Thx Rob. I guess the problem was the separate documentation pages with no link between the two and no mention/gotcha that on IOS you use the utility plugin. I visited that page but since I had the native.showPopup() documentation open I never clicked the link there to get to the “activity showPopup” documentation.

Hi Henrik,

I got the same situation here,
Did you find the way out?
Would you please share the sample code?

Best

Vincent
 

Hey guys.  I did a talk about this long ago and posted some code for the Corona Geek hangout.

I think it still works, but you’ll have to check.

  1. Download this: https://github.com/roaminggamer/CoronaGeek/raw/master/Hangouts/SocialMedia.zip  ( this code is from an old blog post on the site )

(from the larger repository: https://github.com/roaminggamer/CoronaGeek/tree/master/Hangouts )

  1. CD to: SocialMedia\CoronaResources\fromBlogPosts\ios\activityPopup

  2. Build and run the activityPopup code and install it on your device.

If it works, you may be able to grab what you need.  Also, there are other examples of features in that zip file.

Hi roaminggamer,

Thanks for your information.

I’ve download the code and it seems nearly to be ok but the system ask user to login to FB first.

29063348_1474575839337068_57021023915291
I’ve use the facebookLogin() function of the “plugin.facebook.v4a” but it still ask for fb login first.

Would you please take a look for me or any advisement?

Vincent

I’m afraid I can’t help much.  I merely wanted to offer access to the old examples in case there was something that could be dusted off and used there.

As far as FB, I think the credentials must be stored in different places which is why the login isn’t working as expected.

Also, which example did you run?  There were several in the linked file.

You actually have to be logged into the social network services native app to use the iOS controls. That is you have to install and be logged in to Twitter to use Twitter from the activity plugin. You have to be logged into the Facebook app to use Facebook from the activity plugin.

Rob

Thank you so much , I finally get this done.
I used this sample code : activityPopup
The trick is : not put the URL into the item, or the dialog will show only the url instead of image

just like this post : https://forums.coronalabs.com/topic/65047-trouble-using-social-plugin-to-post-photo-on-facebook/?hl=%2Bshare+%2Bphoto+%2Bto+%2Bfacebook#entry336056

Best

Hi Rob,
Thanks a lot!
You are right, I didn’t login to the FB APP, after I did, it works!!

Best

You should use the “activity” plugin (which is part of native.showPopup()) which is the iOS way of accessing email, SMS, and social networks. The “social” plugin really just works for Android.

Rob

The activity plugin is not documented, and I didn’t find anything substantial from a web search, a search on this forum or in the SDK code examples. Should the below guessed code work? Just substitute “social” for “activity” on IOS? It gives the attached screenshot in the IOS Simulator.

I expected to see some options there for IOS apps, but there are none. Is the reason that none of them is set up? Unfortunately I don’t have a test device available at the moment.

shareMsgUrl=function(msg,url) local popupType="social" if \_MODEL~="Android" then popupType="activity" end  isAvailable=native.canShowPopup( popupType ) if (isAvailable) then local listener = {} function listener:popup( event ) dprint( "name: " .. event.name ) dprint( "type: " .. event.type ) dprint( "action: " .. tostring( event.action ) ) dprint( "limitReached: " .. tostring( event.limitReached ) ) end native.showPopup( popupType, { listener = listener, url = url }) else native.showAlert( "Sharing error", "Sharing unavailable!", { "OK" } ) end end

Thanks,
Henrik.

Edit: The above code does not work. It gives the same result as in the Simulator on an Iphone with IOS 11, and Facebook and Mail installed and configured. I.e. the network selector is not populated with social network icons.

Simulator%20Screen%20Shot%2020%20Dec%202
 

The documentation is here:  https://docs.coronalabs.com/plugin/CoronaProvider_native_popup_activity/index.html

It’s in the Utility category instead of Social.

Rob

Thx Rob. I guess the problem was the separate documentation pages with no link between the two and no mention/gotcha that on IOS you use the utility plugin. I visited that page but since I had the native.showPopup() documentation open I never clicked the link there to get to the “activity showPopup” documentation.

Hi Henrik,

I got the same situation here,
Did you find the way out?
Would you please share the sample code?

Best

Vincent
 

Hey guys.  I did a talk about this long ago and posted some code for the Corona Geek hangout.

I think it still works, but you’ll have to check.

  1. Download this: https://github.com/roaminggamer/CoronaGeek/raw/master/Hangouts/SocialMedia.zip  ( this code is from an old blog post on the site )

(from the larger repository: https://github.com/roaminggamer/CoronaGeek/tree/master/Hangouts )

  1. CD to: SocialMedia\CoronaResources\fromBlogPosts\ios\activityPopup

  2. Build and run the activityPopup code and install it on your device.

If it works, you may be able to grab what you need.  Also, there are other examples of features in that zip file.

Hi roaminggamer,

Thanks for your information.

I’ve download the code and it seems nearly to be ok but the system ask user to login to FB first.

29063348_1474575839337068_57021023915291
I’ve use the facebookLogin() function of the “plugin.facebook.v4a” but it still ask for fb login first.

Would you please take a look for me or any advisement?

Vincent

I’m afraid I can’t help much.  I merely wanted to offer access to the old examples in case there was something that could be dusted off and used there.

As far as FB, I think the credentials must be stored in different places which is why the login isn’t working as expected.

Also, which example did you run?  There were several in the linked file.