react-native-call-detection
react-native-call-detection copied to clipboard
event listener is not working
cannot get event and phone number it seems like it doesn't trigger the event listener.
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.
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);
}