@@ -104,7 +104,7 @@ Add the following blocks to your app's `MainActivity`:
104104
105105``` java
106106
107- import com.hoxfon.react.RNTwilioVoice.Constants ;
107+ import com.hoxfon.react.RNTwilioVoice.TwilioModule ;
108108...
109109
110110public class MainActivity extends ReactActivity {
@@ -118,30 +118,7 @@ public class MainActivity extends ReactActivity {
118118 }
119119 @Override
120120 protected Bundle getLaunchOptions () {
121- Bundle initialProperties = new Bundle ();
122- Intent intent = this . getPlainActivity(). getIntent();
123- if (intent == null || intent. getAction() == null ) {
124- return initialProperties;
125- }
126- switch (intent. getAction()) {
127- case Constants . ACTION_INCOMING_CALL_NOTIFICATION:
128- Bundle callInviteBundle = new Bundle ();
129- callInviteBundle. putString(Constants . CALL_SID , intent. getStringExtra(Constants . CALL_SID ));
130- callInviteBundle. putString(Constants . CALL_FROM , intent. getStringExtra(Constants . CALL_FROM ));
131- callInviteBundle. putString(Constants . CALL_TO , intent. getStringExtra(Constants . CALL_TO ));
132- initialProperties. putBundle(Constants . CALL_INVITE_KEY , callInviteBundle);
133- break ;
134-
135- case Constants . ACTION_ACCEPT:
136- Bundle callBundle = new Bundle ();
137- callBundle. putString(Constants . CALL_SID , intent. getStringExtra(Constants . CALL_SID ));
138- callBundle. putString(Constants . CALL_FROM , intent. getStringExtra(Constants . CALL_FROM ));
139- callBundle. putString(Constants . CALL_TO , intent. getStringExtra(Constants . CALL_TO ));
140- callBundle. putString(Constants . CALL_STATE , Constants . CALL_STATE_CONNECTED );
141- initialProperties. putBundle(Constants . CALL_KEY , callBundle);
142- break ;
143- }
144- return initialProperties;
121+ return TwilioModule . getActivityLaunchOption(this . getPlainActivity(). getIntent());
145122 }
146123 };
147124 }
0 commit comments