About to get slated on app store

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
doobox
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 284
Joined: Tue May 24, 2011 11:47 pm

About to get slated on app store

Post by doobox » Mon Nov 25, 2013 10:28 pm

Hi there,

I just released a new iPhone app today : http://www.doobox.co.uk/fav/fav.html

My fundamental understanding is that all things equal, code will run in a predictable way every time without deviance.

I have already had a couple of bug reports in saying there experiencing a crash when importing a contact from there phonebook.
All three have stated there running iPhone 5 and iOS 7.0.4 the same as my device.
All three are saying they only see issue with certain contacts.
All three have been great and provided me with a v-card of an offending contact that causes a crash when attempting an import.

None of these v-card contacts cause a crash here for me when i attempt an import.
So apparently all things are not equal.
What could be different about there setup than mine, when they say there device is the same and there operating system is the same as mine..?

They see a crash at the exact point of clicking one of there contact names in there address book, and screen goes white and app closes.
I have attached the handler that would be active at this time, to see if anything stands out. But like a say its fine for me and every one else but these first three people. at a loss :-(

Code: Select all

// ==== STARTS TO CREATE NEW CONTACT FROM PHONEBOOK ==================
command createFavFromExistingContact
   mobilePickContact -- // so the phonebook is opening for them fine here
   put the result into tContactId -- // could be crashing from here to mating hashes below ########################
   if tContactId is not empty then
      // check if contact already exists
      put the childControlNames of group "main" into tContactGroups
      repeat with x=1 to the number of lines of tContactGroups
         if the cContactId of group line x of tContactGroups is tContactId then
            answer "This contact already exists in your list of fav contacts" with "OK" titled "Stop"
            set the cButtonsDisabled of this stack to false
            exit createFavFromExistingContact
         end if
      end repeat
      put empty into tPhotoData
      put empty into tContactData
      put mobileGetContactData (tContactId) into tContactData
      // get contact data phone numbers
      put "mobile,iphone,main,home,work,other" into tPossNumberTypes
      repeat with x = 1 to 6
         put item x of tPossNumberTypes into tType
         if not(tContactData["phone"][tType][1] is empty) then
            put capitilize(tType) & space & ":" & space & tContactData["phone"][tType][1] into tPhoneNumbers[x]
         end if
      end repeat
      // get contact data names
      put tContactData["firstname"] into tFirstName
      put tContactData["lastname"] into tLastName
      if not(tFirstName is empty) then
         put capitilize(tFirstName) into tFirstName
         put tFirstName into tContactFullName
      end if
      if not(tLastName is empty) then
         put capitilize(tLastName) into tLastName
         if not(tFirstName is empty) then
            put space & tLastName after tContactFullName
         else
            put tLastName into tContactFullName
         end if
      end if
      if the number of chars of tContactFullName > 16 then
         put char 1 to 15 of tContactFullName & ".." into tContactFullName
      end if
      if tContactFullName is empty then
         put "No Name" into tContactFullName
      end if
      // get contact data email addresses
      put "home,work,other" into tPossEmailTypes
      repeat with x = 1 to 3
         put item x of tPossEmailTypes into tType
         if not(tContactData["email"][tType][1] is empty) then
            put capitilize(tType) & space & ":" & space & tContactData["email"][tType][1] into tEmailAddresses[x]
         end if
      end repeat
      // see if a photo exists
      try
         put mergContactImage(tContactId,"original") into tPhotoData
      catch e
         answer "Sorry something unexpected happened" & cr & e with "OK" Titled "Fatal Error"
         set the cButtonsDisabled of this stack to false
         exit createFavFromExistingContact
      end try
      // if no photo we can add one or skip
      if tPhotoData is empty then
         put mergPopSheet("No photo was found with this contact","Skip","","Take Photo,Choose Photo","default") into it
         put it into tResult
         if tResult is "Choose Photo" then
            put pickNewPhoto("library") into tPhotoData
         else if tResult is "Take Photo" then
            put pickNewPhoto("camera") into tPhotoData
         end if
      end if -- // not starting to render so doubt its passing here ########################
      renderNewContactGroup tContactId, tFirstName, tLastName, tContactFullName, tPhoneNumbers, tPhotoData, tEmailAddresses
   else
      if mainGroupIsEmpty() then
         showAddFirstGroup
      end if
      set the cButtonsDisabled of this stack to false
   end if
end createFavFromExistingContact
Kind Regards
Gary

https://www.doobox.co.uk

doobox
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 284
Joined: Tue May 24, 2011 11:47 pm

Re: About to get slated on app store

Post by doobox » Mon Nov 25, 2013 10:32 pm

Oh my, just got followed on Twitter of someone very influential where the app is concerned.
I do hope the bug does not affect him :-)
Kind Regards
Gary

https://www.doobox.co.uk

andyh1234
Posts: 442
Joined: Mon Aug 13, 2007 4:44 pm
Location: Eccles UK
Contact:

Re: About to get slated on app store

Post by andyh1234 » Tue Nov 26, 2013 1:32 am

Im afraid ive had the same reports from one of my apps, never been able to replicate it.

doobox
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 284
Joined: Tue May 24, 2011 11:47 pm

Re: About to get slated on app store

Post by doobox » Tue Nov 26, 2013 1:42 am

I literally just replicated it moments ago.

Its all to do with the details in the contacts info.
I could not replicate it using the exact same details as any of the problematic contacts from any of the affected users to replicate that contact on my device.
But i just stumbled on a contact that existed in my phone, that i don't even know how it got there "current location" and if i try and import that one to my app i get the same crash. so i feel i am on the right track. at least i can run some tests now anyway.
Kind Regards
Gary

https://www.doobox.co.uk

paul_gr
Posts: 319
Joined: Fri Dec 08, 2006 7:38 pm
Location: Blenheim, New Zealand

Re: About to get slated on app store

Post by paul_gr » Tue Nov 26, 2013 2:08 am

Hi Gary,
App looks good.
If it's only certain contacts giving errors maybe some names are hyphenated or contain accents. Addresses entered in an unusual format, Phone numbers using spaces or hyphens as separators, etc.
Just curious -- is the function "capitilize" spelt correctly? I presume it is a custom function as it is not in the dictionary.
In LC most of us would use the built in function toUpper unless you have a special reason not to.

Paul
Last edited by paul_gr on Tue Nov 26, 2013 2:15 am, edited 1 time in total.

doobox
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 284
Joined: Tue May 24, 2011 11:47 pm

Re: About to get slated on app store

Post by doobox » Tue Nov 26, 2013 2:10 am

Nailed it, but i really don't know how i can move forward because of where i found the crash :

Code: Select all

      answer "just checking we are ok here" -- we are indeed ok and the tContactId is good
      put mobileGetContactData (tContactId) into tContactData
      answer "we have the contact data now" -- oh no we dont we have now crashed
This is crashing when retrieving the contact data for just certain contacts.
Cant see there is really much i can do about this can you..?
Kind Regards
Gary

https://www.doobox.co.uk

doobox
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 284
Joined: Tue May 24, 2011 11:47 pm

Re: About to get slated on app store

Post by doobox » Tue Nov 26, 2013 2:21 am

i tried :

Code: Select all

      answer "just checking we are ok here" -- we are indeed ok and the tContactId is good
      try
      put mobileGetContactData (tContactId) into tContactData
      catch e
      answer e -- // but its gone before a get any output here
      end try
      answer "we have the contact data now" -- oh no we dont we have now crashed
Kind Regards
Gary

https://www.doobox.co.uk

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: About to get slated on app store

Post by Simon » Tue Nov 26, 2013 2:25 am

I'm going to go with hidden characters in the contact data. Like a return in the phone number field (if you can do that).
Now it appears that inputting it as a v-card seems to fix the problem.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

doobox
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 284
Joined: Tue May 24, 2011 11:47 pm

Re: About to get slated on app store

Post by doobox » Tue Nov 26, 2013 2:29 am

paul_gr wrote:Hi Gary,
App looks good.
If it's only certain contacts giving errors maybe some names are hyphenated or contain accents. Addresses entered in an unusual format, Phone numbers using spaces or hyphens as separators, etc.
Just curious -- is the function "capitilize" spelt correctly? I presume it is a custom function as it is not in the dictionary.
In LC most of us would use the built in function toUpper unless you have a special reason not to.

Paul
Your right Paul i am a terrible speller. But the function call and the function are indeed spelt the same. As you can see from my later posts i found the crashing line.
But it could not really be any worse as i don't think i now have any control over this.
What gets returned by the mobileGetContactData in its large nested array comes as is as far as i can see. and i don't think i can get the data any other way.

There is obviously some corrupt data or special chars in these problematic contacts, but if i can't get the data in this line i can't check for errors in it.
Kind Regards
Gary

https://www.doobox.co.uk

doobox
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 284
Joined: Tue May 24, 2011 11:47 pm

Re: About to get slated on app store

Post by doobox » Tue Nov 26, 2013 2:58 am

Looks like i have the problem with the failing contacts identified.
Seems some old contacts in the phone collapse differently when not editing. The image below illustrates this.
There is no way to code my way out of this one i don't think.

Image
Kind Regards
Gary

https://www.doobox.co.uk

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: About to get slated on app store

Post by LCNeil » Tue Nov 26, 2013 9:44 am

Hi Gary,

I'm Sorry to hear about the crash that is occurring in your app.

If possible, could you file a report on this issue with our Quality Control Team and they will be able to investigate it further.

http://quality.runrev.com

Kind Regards

Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
LiveCode – Realize fast, compile-free coding

--

doobox
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 284
Joined: Tue May 24, 2011 11:47 pm

Re: About to get slated on app store

Post by doobox » Tue Nov 26, 2013 6:19 pm

Just a small update..

The great Livecode team have found and fixed this bug.
Anyone else that experienced it will be good in a few days :-)
Kind Regards
Gary

https://www.doobox.co.uk

Post Reply

Return to “iOS Deployment”