react-native-call-detection icon indicating copy to clipboard operation
react-native-call-detection copied to clipboard

event listener is not working

Open McDreamy opened this issue 4 years ago • 2 comments

cannot get event and phone number it seems like it doesn't trigger the event listener.

McDreamy avatar Dec 23 '20 12:12 McDreamy

Hey @McDreamy!

https://github.com/priteshrnandgaonkar/react-native-call-detection/pull/83 My PR should fix this issue.

Let me know if you need any help.

maikenunes avatar Jan 11 '21 21:01 maikenunes

This works for me inside the android/app/src/main/java/com/MainActivity.java

import android.Manifest;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.telephony.PhoneStateListener;
import android.widget.Toast;


public class MainActivity extends ReactActivity {
private static final int REQUEST = 112;


  @Override
	protected void onCreate(Bundle savedInstanceState) {
    	super.onCreate(null);
     
    	CleverTapModule.setInitialUri(getIntent().getData());
      int permissionCheck = ContextCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE);

      if (permissionCheck != PackageManager.PERMISSION_GRANTED) {
          ActivityCompat.requestPermissions(this, new String[]{android.Manifest.permission.READ_PHONE_STATE}, REQUEST);
      }

amitmehtacode avatar May 23 '23 11:05 amitmehtacode