iOS Question B4i equivalent to B4a

Stefano Di Chiano

Active Member
Licensed User
Hi,
I need to make the B4i version of a B4a app, but I can't find all the equivalent libraries and some code parts. Can someone help me find what I need or suggest me another way to get the same result?
I'm using these libraries:
- QRCodeReaderV102, "BitmapCreator", "Bytes Converter" to scan and create QR codes.
- GeoLocation, GPS, and "RuntimePermissions" to get the location of the user when scanning a QR code.

I'm also looking for the equivalent of:
Write file in DirDefaultExternal:
File.WriteList(File.DirDefaultExternal, "File.txt", List)
and:
jsonparser nextvalue:
Dim parser As JSONParser
parser.NextValue
I see that there is "parser.NextObject" but the IDE gives me a warning when I try to assign the returned value to a string. I wonder if that's ok.
 

aeric

Expert
Licensed User
Longtime User
To scan barcode in B4i you can use iBarcode library
or check
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
To generate QR code

The forum search is working
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
for barcodes you have the iBarcode library:

and for qr barcode you have a b4x solution:

GPS location tracking can be done like this:

there are no runtime permission like in android but what you need to do is add an explanation text of the purpose of using the special hardware like GPS, microphone, etc... to the Plist.

example for GPS:
B4X:
  #PlistExtra:<key>NSLocationWhenInUseUsageDescription</key><string>Used to display the current navigation data.</string>
   #PlistExtra:<key>NSLocationUsageDescription</key><string>Used to display the current navigation data.</string>


File.WriteList(File.DirDefaultExternal, "File.txt", List)

* in ios you cannot access the external storage so all you can do is saving data in your File.DirDocuments directory.

B4X:
    File.WriteList(File.DirDocuments,"File.txt", List)

(there are more folders you can save data to but File.DirDocuments is the place you should save data that u want to use in your app)

note that you can save images to the gallery app and also make your folder sync-able with iTunes! but access to external storage is not possible.

* json parser (iJson) should be the same in b4i.
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
I almost never use json in my apps but i would try parsernextobject. Seems logical for me. Does it return the next value?
 
Upvote 0

Stefano Di Chiano

Active Member
Licensed User
I almost never use json in my apps but i would try parsernextobject. Seems logical for me. Does it return the next value?
No, and I get the following error:
Application_Start
Application_Active
FBSDKLog: Missing [FBSDKAppEvents appEventsState.appID] for [FBSDKAppEvents flushOnMainQueue:]
FBSDKLog: Missing [FBSDKAppEvents appEventsState.appID] for [FBSDKAppEvents flushOnMainQueue:]
Error occurred on line: 59 (Login)
Error parsing string: Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.}
Stack Trace: (
CoreFoundation E2D6A76B-6879-31A3-8168-DF49F94E17CD + 1222248
libobjc.A.dylib objc_exception_throw + 56
CoreFoundation E2D6A76B-6879-31A3-8168-DF49F94E17CD + 133720
Uppeee -[B4IJSONParser parse] + 220
Uppeee -[b4i_login _jobdone:] + 1152
CoreFoundation E2D6A76B-6879-31A3-8168-DF49F94E17CD + 1247424
CoreFoundation E2D6A76B-6879-31A3-8168-DF49F94E17CD + 6768
Uppeee +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1608
Uppeee -[B4IShell runMethod:] + 448
Uppeee -[B4IShell raiseEventImpl:method:args::] + 2172
Uppeee -[B4IShellBI raiseEvent:event:params:] + 1580
Uppeee -[B4ICommon CallSub4::::] + 316
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
have a look at this:

 
Upvote 0
Top