Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Update url_launcher to new plugin registry #26

Merged
merged 5 commits into from
May 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions packages/url-launcher/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
## [0.3.6] - 2017-05-9
## [0.4.0] - 2017-05-09

* Upgrade to new plugin registration.

## [0.3.6] - 2017-05-09

* Fix workaround for failing dynamic check in Xcode 7/sdk version 9.

## [0.3.5] - 2017-05-8
## [0.3.5] - 2017-05-08

* Workaround for failing dynamic check in Xcode 7/sdk version 9.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package io.flutter.plugins.url_launcher;

import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.net.Uri;
Expand All @@ -13,21 +14,22 @@
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
import io.flutter.plugin.common.MethodChannel.Result;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.PluginRegistry.Registrar;

/**
* UrlLauncherPlugin
*/
public class UrlLauncherPlugin implements MethodCallHandler {
private FlutterActivity activity;
private final Activity activity;

public static UrlLauncherPlugin register(FlutterActivity activity) {
return new UrlLauncherPlugin(activity);
public static void registerWith(Registrar registrar) {
MethodChannel channel = new MethodChannel(registrar.messenger(), "plugins.flutter.io/url_launcher");
UrlLauncherPlugin instance = new UrlLauncherPlugin(registrar.activity());
channel.setMethodCallHandler(instance);
}

private UrlLauncherPlugin(FlutterActivity activity) {
private UrlLauncherPlugin(Activity activity) {
this.activity = activity;
new MethodChannel(
activity.getFlutterView(), "plugins.flutter.io/url_launcher").setMethodCallHandler(this);
}

@Override
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@

import android.os.Bundle;
import io.flutter.app.FlutterActivity;
import io.flutter.plugins.PluginRegistry;
import io.flutter.plugins.GeneratedPluginRegistrant;

public class MainActivity extends FlutterActivity {
PluginRegistry pluginRegistry;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
pluginRegistry = new PluginRegistry();
pluginRegistry.registerAll(this);
GeneratedPluginRegistrant.registerWith(this);
}
}
Loading