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

Plugin Does Not Work! #11

Open
adelsadek1 opened this issue Feb 6, 2019 · 6 comments
Open

Plugin Does Not Work! #11

adelsadek1 opened this issue Feb 6, 2019 · 6 comments
Labels
user question User question about how to use the code

Comments

@adelsadek1
Copy link

adelsadek1 commented Feb 6, 2019

Hello I Have Tried This Plugin and it was working fine but after several days stops this issue happens on some devices.
here the code ;

  checkPermissions(){
    var self = this;
    var wind = this.__window().plugins;
    
    wind.callLog.hasReadPermission(function(success) {
     if (success) {
       self.getLogs();
     }else{
      wind.callLog.requestReadPermission(()=>{
        self.getLogs();
      })
     }
      
    });
  }
  getLogs(){
    var wind = this.__window().plugins;
    this.startLoader();
    this.filters = [{
      "name": "date",
      "value":1514820875,
      "operator": ">=",
  }];
    wind.callLog.getCallLog(this.filters, (res)=>{
      this.mobileNumbers = res; // Return Zero 
    }, (error)=>{
      alert(error)
    })
  }

this is the device info.
model: Redmi5
version: 7.1.2 N2G47H

the response i got = 0

Can you look into this ticket.

Thanks

@Bruno361 Bruno361 added the user question User question about how to use the code label Feb 6, 2019
@Bruno361
Copy link
Member

Bruno361 commented Feb 6, 2019

Hi,
Can you please stop spamming by opening new issues again ? This page is not for user support or a discussion forum.
In a previous issue of yours, you stated that the plugin was working for you and now you say it doesn't, without any further information. We do not have the time nor resource to solve issues in your code.

@adelsadek1
Copy link
Author

Hi,
I am not spamming I have installed this plugin on 8 devices and it is working just on 2.
please tell what is the information we need so I proved you?

Thanks

@LarryHuang77
Copy link

LarryHuang77 commented Mar 20, 2019

Hi all,
I applied this plugin in my app on one day of Feb 2019. About 9k Android mobiles of my users have ran it with READ_CALL_LOG and READ_CONTACTS permissions both granted until now. Most of them read call logs successfully, while 12.7% of them returned nothing, and 1.2% of them threw exceptions.
I can't find any regular pattern in mobile models or android versions between the successful and the failing.
I am about to solve this. But I can't get any one of the failing mobiles for debugging.
@adelsadek1, I'm in Beijing China. I assume you are a Chinese too because of your redmi mobile. Is it possible to borrow or buy a failing device from you?

Thank all.

@LarryHuang77
Copy link

One bug found in CallLog.java: line 192 should be callLogItem.put("cachedNumberLabel", mCursor.getString(7));
The type of cachedNumberLabel is TEXT.

@VoltX
Copy link
Member

VoltX commented Mar 25, 2019

Thanks @LarryHuang77 for your debug.
I fixed this in f1133dc

@VivekMoyal28
Copy link

VivekMoyal28 commented Jul 20, 2019

Thanks for the plugin i am using it and its working fine.
Here is the code so that others will get the help of it.
First of all use add the plugin and then use the below code in your html to get the list.


<html>
    <head>
    <title>Device Ready Example</title>
    </head>
    <body>
        <h1>Hello</h1>
        <div class="recent-calls"></div>
    </body>
    <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/index.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/jquery-3.2.1.min.js"></script>
    <script>
        document.addEventListener("deviceready", onDeviceReady, false);

function onDeviceReady() {
    window.plugins.callLog.requestReadPermission();
    window.plugins.callLog.requestReadPermission();
    var filters = [{
    "name": "number",
    "value": "",
    "operator": "=="
},
{
    "name": "date",
    "value": 1547962747000,
    "operator": ">="
}];

        window.plugins.callLog.getCallLog(filters, function(data) {
            $('.recent-calls').text(JSON.stringify(data));
            alert(data);
            console.log(data);
        }, function() {
        });
}
        
        </script>
</html>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user question User question about how to use the code
Projects
None yet
Development

No branches or pull requests

5 participants