Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Limit the sharing options using native.showPopup
Started by conor1 Jan 03 2017 02:38 AM

3 replies to this topic
native.showpopup social
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

conor1

[GLOBAL: userInfoPane.html]
conor1
  • Contributor

  • 166 posts
  • Corona SDK

Hi,

 

Successfully implemented native.showPopup on Android. However, I'd rather limit the user to just a few apps for sharing. Is there any way to do that?

 

Right now on my phone I get dropbox, convert to pdf, etc, etc. A really long list.

Rather just offer the usual 3 or 4.

 



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,646 posts
  • Enterprise

We don't provide a way to add or remove items from the various social sharing plugins.

 

Rob



[TOPIC: post.html]
#3

sonyayllc

[GLOBAL: userInfoPane.html]
sonyayllc
  • Enthusiast

  • 96 posts
  • Corona SDK

Hi conor1

 

I was wondering if you found a good resource for implementing this on Android.  It seems like the guide is more useful for iOS - unless I am missing something...

 

Here is what I have, but it does nothing on the Android device, and the simulator just says to build for an iOS device...

	local shareButton_fishing = widget.newButton({
		defaultFile = 'images/buttons/share.png',
		overFile = 'images/buttons/share-over.png',
		width = 32, height = 35,
		x = halfW + 155, y = 320,
		onRelease = function()
			--sounds.play('tap')
			--composer.gotoScene('scenes.reload_game', {params = params.levelId + 1})
			--post("onRestart", { delay = 100 } ) 
			local shareText = "This is the fishing score I want to share"
--			{service = serviceName,  message = shareText, image =  {
--            { filename="world.jpg", baseDir=system.ResourceDirectory },
--            { filename="bkg_wood.png", baseDir=system.ResourceDirectory } }, 
--			url =  { "http://www.coronalabs.com", "http://docs.coronalabs.com" }}
			if system.getInfo("targetAppStore") == "google'"then
				native.showPopup( "social", {service = "share",  message = shareText,}	)
			elseif system.getInfo("targetAppStore") == "apple" then
				local itemsOptions = {{type = "string", value = "This is my apple share text"}}
				native.showPopup("activity",{	items=itemsOptions,	})
			elseif system.getInfo( "environment" ) == "simulator" then
				print( "You're in the Corona Simulator." )
				native.showPopup("social", {message = shareText,})
			end
		end
	})

Thanks for your time and help.



[TOPIC: post.html]
#4

sonyayllc

[GLOBAL: userInfoPane.html]
sonyayllc
  • Enthusiast

  • 96 posts
  • Corona SDK

oops, had a typo - seems to work as expected

if system.getInfo("targetAppStore") == "google'"then

"google' " should be "google"




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: native.showpopup, social