Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

How to add an external plugin? (Adjust)
Started by maximo97 Mar 23 2020 10:50 AM

- - - - -
14 replies to this topic
adjust plugin
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

maximo97

[GLOBAL: userInfoPane.html]
maximo97
  • Contributor

  • 244 posts
  • Corona SDK

Hi I would like to know how to add an external plugin in my project.

In particular adjust.

 

I found this but didn't understand much:

https://github.com/adjust/corona_sdk



[TOPIC: post.html]
#2

pixec

[GLOBAL: userInfoPane.html]
pixec
  • Contributor

  • 204 posts
  • Corona SDK

Make corona native project and then follow the instructions there.

[TOPIC: post.html]
#3

maximo97

[GLOBAL: userInfoPane.html]
maximo97
  • Contributor

  • 244 posts
  • Corona SDK

But I've already finished my app. Do I have to change everything?



[TOPIC: post.html]
#4

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,679 posts
  • Enterprise

No not really, just how you build plus creating the plugin.

 

A Corona Native project is like 95% your Lua code and 5% the native features you want. There is a tutorial either on docs.coronalabs.com or on the blog that while old, basically walks you through setting up a native project.

 

Rob



[TOPIC: post.html]
#5

maximo97

[GLOBAL: userInfoPane.html]
maximo97
  • Contributor

  • 244 posts
  • Corona SDK

Do I need to edit my build and config files then?

Can I just add the extra stuff and leave the rest like that?



[TOPIC: post.html]
#6

maximo97

[GLOBAL: userInfoPane.html]
maximo97
  • Contributor

  • 244 posts
  • Corona SDK

Hey Rob I saw the guide and much more but I still can't make it work, can you just give me a hand please?

 

I downloaded the file: libplugin_adjust.a

 

So I added it as requested: file_1.png

 

 

I use the code in main.lua: file_2.png

 

But then when I go to buil I get an error: file_3.png

 

I think it could be a stupid mistake but I don't know what to do. Can you help me solve it?

 

 



[TOPIC: post.html]
#7

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Corona Geek

  • 1,051 posts
  • Corona Staff

Error means that plugin is not in directory Xcode is looking for static libraries. You can add it in Xcode's "Build Settings" Library Search Path in project properties, but easier, imo, is to open file CoronaNative.xcconfig, and edit line 7

From

LIBRARY_SEARCH_PATHS = $(inherited) "$(CORONA_ROOT)/Corona/ios/lib"
to

LIBRARY_SEARCH_PATHS = $(inherited) "$(CORONA_ROOT)/Corona/ios/lib" "$(PROJECT_DIR)"
And put your library next to your project.

Also, latest build has Self-Hosted plugins activated for everyone. So now it is really matter of hosting simple file to get it working in Simulator, without having to resort to native



[TOPIC: post.html]
#8

maximo97

[GLOBAL: userInfoPane.html]
maximo97
  • Contributor

  • 244 posts
  • Corona SDK

Thanks a lot!! I tried as you said but I keep getting the same errors.

I guess I'm forgetting to do something that is obvious to you.

 

I also tried the simulator version but nothing. I tried to configure the buil file but it didn't help.

 

I am working with version 2020.3577.

I had switched to native only to add this plugin otherwise my project was fine.

 

I don't know if the problem is me or the plugin.

 

Could you kindly make me a small project that simply includes the adjust library and calls it to the main (okay without using native). At this point I'm really in front of a wall.



[TOPIC: post.html]
#9

uerceg

[GLOBAL: userInfoPane.html]
uerceg
  • Observer

  • 7 posts
  • Corona SDK

Hi @maximo97

 

Ugi in here from Adjust. Feel free to clone corona_sdk repository and inside of the plugin folder, you can find an app example which should be functional. Inside of plugin/ios folder you can open App.xcodeproj file and see how Xcode project of the app which uses our SDK looks like and see what you might be doing differently.

 

Cheers



[TOPIC: post.html]
#10

maximo97

[GLOBAL: userInfoPane.html]
maximo97
  • Contributor

  • 244 posts
  • Corona SDK

Here I am. Thank you @vlads

Thanks to your passage it worked on native. I was stuck. I tried to do this without native but it doesn't find the plugin and it gives me an error. Is there any other step I need to do to work. Thanks again.
And thanks also to @
uerceg

[TOPIC: post.html]
#11

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Corona Geek

  • 1,051 posts
  • Corona Staff

Hey. I you want to use plugin from the Corona Simulator you can add this to your build settings, and that's it.

settings =
{
    plugins =
    {
        ["plugin.adjust"] =
        {
            publisherId = "com.adjust",
            supportedPlatforms = {
                iphone={url="https://vlad-test.s3.amazonaws.com/plugin_adjust-iphone.tgz"},
                ["iphone-sim"]={url="https://vlad-test.s3.amazonaws.com/plugin_adjust-iphone-sim.tgz"},
            }
        },
    }
}

I created pull request to push this changes upstream. Also, if adjust could host those files, it would be awesome.


  • uerceg likes this

[TOPIC: post.html]
#12

maximo97

[GLOBAL: userInfoPane.html]
maximo97
  • Contributor

  • 244 posts
  • Corona SDK

Thanks again!

 

But maybe there is an error in the link.I get this:error.png

 

 

Ah, and thanks for the pull request


Edited by maximo97, 26 March 2020 - 10:21 AM.


[TOPIC: post.html]
#13

uerceg

[GLOBAL: userInfoPane.html]
uerceg
  • Observer

  • 7 posts
  • Corona SDK

@vlads Thanks for the PR! Just one quick question on it - from what I see it should be completely related to iOS example app project settings, so no need to publish new plugin version because of the changes?

 

And also one question on the files you hosted on AWS - do you need them hosted somewhere specially or I simply put them to some folder in our GitHub repo? I guess it would be nice to also add instructions you wrote above on how to run the plugin in Corona Simulator to our README.



[TOPIC: post.html]
#14

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Corona Geek

  • 1,051 posts
  • Corona Staff

Sorry for misunderstanding. Try to paste that code, and Simulator would give you an error that plugin cannot be downloaded, that is expected. Press OK and try to build your app for iOS.

 

Uerceg, no pull request does not require new version. It only makes 2 new files, in BuiltPlugin, when build.sh is called. Those files can be used as self-hosted plugins in Corona Simulator builds. Basically no need for Native builds anymore


  • uerceg likes this

[TOPIC: post.html]
#15

maximo97

[GLOBAL: userInfoPane.html]
maximo97
  • Contributor

  • 244 posts
  • Corona SDK

@vlads

Everything works fine. Thank you very much


  • uerceg likes this


[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: adjust, plugin