Private native dependencies in Flutter plugin

25 views Asked by At

For a Flutter plugin we're working on, we need to download a native dependency for both Android and iOS, which is hosted on a cloud service that requests a token in the URL specifying the dependency location:

https://mycloudservice/MYTOKEN/dependency

We would like to let the plugin's user specify the custom token in a file so that at build time, we can read it and place it inside the URL to download both dependencies.

While this can be done quite easily on Android via Gradle (see snippet below), I could not find a way to do it for iOS.

Android Gradle snippet:

def properties = new Properties()
def repoInfoFile = new File(getRootDir(), "token.properties")

properties.load(repoInfoFile.newReader()) 
def repoToken = properties.getProperty("MY_TOKEN") 
rootProject.allprojects { 
  repositories { 
    google() 
    mavenCentral() 
    maven { 
      setUrl("https://mycloudservice/$repoToken/dependency/maven") 
    } 
  } 
}

any ideas?

Thanks all!

The idea I had was to specify the logic in a new Podfile inside the ios folder of the plugin, but I can't figure out how to run pod install for that pod when I build the Flutter app

0

There are 0 answers