Last active
January 11, 2019 07:37
-
-
Save happyharis/d4df392cb87672ebfe29d79ecd7a554a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import io.flutter.app.FlutterActivity; | |
| import io.flutter.plugin.common.MethodCall; | |
| import io.flutter.plugin.common.MethodChannel; | |
| import io.flutter.plugin.common.MethodChannel.MethodCallHandler; | |
| import io.flutter.plugin.common.MethodChannel.Result; | |
| import com.uxcam.UXCam; // Make sure you have this import | |
| public class MainActivity extends FlutterActivity { | |
| // The methodChannel object name created in the UXCam file | |
| private static final String CHANNEL = "com.ur.app/uxcam"; | |
| @Override | |
| public void onCreate(Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); | |
| GeneratedPluginRegistrant.registerWith(this); | |
| new MethodChannel(getFlutterView(), CHANNEL).setMethodCallHandler(new MethodCallHandler() { | |
| @Override | |
| public void onMethodCall(MethodCall call, Result result) { | |
| if (call.method.equals("init")) { | |
| String apiKey = call.argument("apiKey"); | |
| UXCam.startWithKey(apiKey); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment