From 54b593b9fe3fd288bea5d706ecf95dcc6f7d83fe Mon Sep 17 00:00:00 2001 From: Aroldo Goulart Barros <38509926+SnowLew@users.noreply.github.com> Date: Tue, 15 Jun 2021 17:34:21 -0400 Subject: [PATCH] Update README.md Change markdown diff to comments for easier import (crtl + c, crtl + v) --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 1312fb6..6602ba8 100644 --- a/README.md +++ b/README.md @@ -102,12 +102,12 @@ AppRegistry.registerComponent('testProject', () => appStack); Event listener will work fine when your app is in background or foreground. If it is not running, to capture the first event we need to do some extra work. Make the following changes in your `MainActivity.java` file of React Native app, -```diff +``` package com.yourpackage; -+import android.os.Bundle; +import android.os.Bundle; // <-- Add this import import com.facebook.react.ReactActivity; -+import com.codegulp.invokeapp.RNInvokeApp; +import com.codegulp.invokeapp.RNInvokeApp; // <-- Add this import public class MainActivity extends ReactActivity { /** @@ -119,11 +119,11 @@ public class MainActivity extends ReactActivity { return "testProject"; } -+ @Override -+ protected void onCreate(Bundle savedInstanceState) { -+ super.onCreate(savedInstanceState); -+ RNInvokeApp.sendEvent(); -+ } + @Override // <-- Add this function + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + RNInvokeApp.sendEvent(); + } } ```