Bug in the ContactsService.wgz demo application
Hello,
I’m using the PlatformServices2.0, I was testing the “ContactsService.wgz” example that comes with the library, because I will need to access the contacts list on the phone. In the simulator everything works fine, but when I deploy the application in the phone (Nokia C7-00), it crashes.
It crashes inside the library in the “__sp_contact_iterator_get_next()” function in the following line:
[QUOTE]_3d4.close();[/QUOTE]
You get the following error:
getContactsCallBack: TypeError: Result of expression‘_3d4.close‘ [undefined] is not a function.
The issue is that for some reason, the close function is always undefined for every contact of the list. Here’s a manual debug of the _3d4 object (corresponding to an entry in the contacts list).
[QUOTE](string) id: -some random stuff-
(Object) SyncClass
(string) Label: Synchronisation
(string) Value: private
(undefined) close: null: undefined
(object) LastName
(string) Label: Last Name
(string) Value: A
(undefined) close: null: undefined
(object) First Name
(string) Label: FirstName
(string) Value: Mr
(undefined) close: null: undefined
(object) LandPhoneGen
(string) Label: Telephone
(string) Value: 558999658
(undefined) close: null: undefined
(object) MobilePhoneGen
(string) Label: Mobile
(string) Value: 558999659
(undefined) close: null: undefined
(object) EmailGen
(string) Label: Mail
(string) Value: [email]gaasda@akf.com[/email]
(undefined) close: null: undefined
(undefined) close: null: undefined[/QUOTE]
When I debug in the simulator the last close becomes:
(function) close: function() {}
I solved the problem by changing the “__sp_contact_iterator_get_next()” code and adding :
[QUOTE]if(_3d4 && typeof(_3d4.close) === "function"){
_3d4.close(); }[/QUOTE]
Has anybody encountered this problem? Do you know if there is a more elegant solution?
Any suggestions are welcome.
Thanks in advance!
Re: Bug in the ContactsService.wgz demo application
Thank you for reporting this. I have forwarded this to R&D for further investigation.
-Ilkka
Re: Bug in the ContactsService.wgz demo application
is there any progress on this? it appears to be a minor problem. the API will be a waste if this function doesn't work and might have to give up developing on nokia and move to another phone
Re: Bug in the ContactsService.wgz demo application
Hi,
This issue is fixed in Browser 7.4.2 (and newer).
For devices that does not have this browser, only solution is to modify platformservices.js, as pere.marti
has done in the first post.
Br,
Ilkka