Skip to content

michael-cheung-thebus/package_replaced

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

package_replaced

Allow Flutter to respond to Android MY_PACKAGE_REPLACED intent

To use this plugin, besides importing, you will also have to add PackageReplacedPlugin.setPluginRegistrantCallback() to the Android side of your app.

i.e. subclass FlutterApplication/implement PluginRegistry.PluginRegistrantCallback and call it in onCreate:

class OverrideApplication: FlutterApplication(), PluginRegistry.PluginRegistrantCallback{

    override fun onCreate() {
        super.onCreate()
        PackageReplacedPlugin.setPluginRegistrantCallback(this)
    }

    override fun registerWith(p0: PluginRegistry?) {
        GeneratedPluginRegistrant.registerWith(p0)
    }
}

and in your manifest,

<application android:name=".OverrideApplication">
    **other manifest stuff here**
</application>

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published