Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

event listener is not working #81

Open
McDreamy opened this issue Dec 23, 2020 · 2 comments
Open

event listener is not working #81

McDreamy opened this issue Dec 23, 2020 · 2 comments

Comments

@McDreamy
Copy link

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

@maikenunes
Copy link

Hey @McDreamy!

#83
My PR should fix this issue.

Let me know if you need any help.

@amitkumar144
Copy link

amitkumar144 commented May 23, 2023

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);
      }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants