6

I coded an application with phonegap.

I have a phone numbers list that I receive from a server. when an item from a list is clicked the controller trigers this function:

$scope.call = function(number){
        document.location.href = 'tel:' + number;
    }

on an iPhone it's ok, but on an Android I get:

unsafe:tel:+97235726333

why? Is it a utf-8 encoded problem?

Avijit
  • 3,834
  • 4
  • 33
  • 45
ben ezra
  • 553
  • 1
  • 3
  • 14
  • 3
    Are you by any chance data binding `tel:` href attributes with Angular? Angular uses a whitelist for protocols, and will add `unsafe:` before any URL using a protocol that uses a protocol that's not in the whitelist. See here for more: http://stackoverflow.com/questions/15606751/angular-changes-urls-to-unsafe-in-extension-page – Adrien Delessert Feb 04 '14 at 21:39
  • i tried add the code that displayed there and get this error: Uncaught TypeError: Object #<$CompileProvider> has no method 'aHrefSanitizationWhitelist' from MyApp – ben ezra Feb 05 '14 at 08:25
  • ok, i change thr function to urlSanitizationWhitelist i will check that thank you – ben ezra Feb 05 '14 at 08:27

1 Answers1

0

some systems dont take the + in to considerations, i know i have had some issues with that in the past with older projects. one thing you could do is replace the + with 00 two zero's is the same as a plus, which then becomes a full integer without the + which might the the issue with the internal parser.

$scope.call = function(number){
   document.location.href = 'tel:' + number.replace("+","00");
}