Help please with native.popup.activity runtime error

Hi,

I am having a problem with a runtime error on iOS. The error is:

module 'CoronaProvider.native.popup.activity' not found:resource (CoronaProvider.native.popup.activity.lu) does not exist in archive.

In build.settings I have:

plugins = { ["CoronaProvider.native.popup.social"] = { publisherId = "com.coronalabs" }, ["CoronaProvider.native.popup.activity"] =         {     publisherId = "com.coronalabs",     supportedPlatforms={"iphone"}      },

In my code, in a handleButtonEvent, I have:

if (system.getInfo("environment") == "device") then local platformName = system.getInfo("platformName") if platformName == "Android" then share\_on\_android() else share\_on\_ios() end end

The share_on_ios() function has:

function share\_on\_ios () local itemsToShare = { { type = "image", value = { filename = "social\_media.png", baseDir = system.DocumentsDirectory } }, { type = "url", value = "http://www.gameforkstudio.com" }, } local options = { items=itemsToShare, listener=popupListener } local activity = require( "CoronaProvider.native.popup.activity" ) native.showPopup( "activity", options ) end

Is there anything else I need to add to my code to include the popup plugin into the app?

Thanks.

Just an update. The app crashes as soon as I call:

local activity = require( “CoronaProvider.native.popup.activity” )

Is this the right plugin to share an image on iOS? On Android I am using the “social popup” instead.

Can the “social popup” be used on iOS?

Thanks.

The social popup on iOS is for iOS 7 and earlier. It should not be used on modern iOS devices. Activity is the one you should be using. 

Can you make a .zip file with your build.settings, config.lua and main.lua and a simple button to show the popup and share it here?  You probably should upload the .zip file to some place like Dropbox or Google Drive and share it to get a URL and post the URL here.

Rob

Hi Rob,

Thanks for the reply.

As requested, a zip file with a simple app was created. It shows an image of a cat. When you click on the cat, it should share the image but instead I get a crash.

https://1drv.ms/u/s!AsobMPtnfQiBj2a19EOjUa7Yk5mK?e=g3GK0q

I am sure it is something stupid I am doing. Unfortunately I don’t have the experience to pinpoint it  :frowning:

(Hope I shared the file correctly and that you can access it).

The problem is in your build.settings file.  You have this:

supportedPlatforms={"iphone"}

when it should be:

supportedPlatforms={iphone = true}

In your version you’re creating a table named supportedPlatforms, which is being treated as a numerically indexed array and supportedPlatorms[1] = the string “iphone”.  However we are expecting a table that contains key-value pairs that’s indexed by the key. In the second version the key is “iphone” and the value is true.

Make that change and the activity popup will work exactly as expected.

Rob

Thanks Rob. It worked  :slight_smile: