#43529
ul
Participant

Hi Ayelet,

 

Thank you for pointing out about code in AppDelegate.m.

I manage to make it work, however not in pure Swift code, but I had to write  objective-C wrapper.

For those who struggle with same problem in Swift:

1. Add new File -> Cocoa Class -> Name Your Class (Mine is “Wrapper”), Subsclass: NSObject, Language: Objective-C -> allow Birgde-Header to be added.
2. Add Method to your Objective-C .m and .h file, for Example -(void)test;
3. Copy following code to newly created method in Objective-C to .m file:

    [[CPScioCloud sharedInstancesetCliend_id:@”4b5ac28b-28f9-4695-b784-b7665dfe3763″];
    [[CPScioCloud sharedInstancesetRedirect_uri:@”https://www.consumerphysics.com”];
    [[CPScioCloud sharedInstancesetEnableLogs:YES];

 

    [[CPScioDevice sharedInstancesetEnableLogs:YES];
This code is from SampleApp
4. Go to your Bidging-Header file, and add #import “Name Your Class.h” (mine is: #import “Wrapper.h”)
4a. Also add #import <ScioSDK/ScioSDK.h> on top of your .h file
5. Go to your AppDelegate.swift, add the following code to func application: UIAplication, did FinishLaunchingWithOption… it is the first method in this file:var someName = Wrapper();
someName.MethodName(); (mine is: someName.test();)

6. Run the App, don’t forget to turn Wifi on, on your iPhone/iPod.
and Voila it should work. :wacko:

  • This reply was modified 7 years, 8 months ago by ul. Reason: I had forgotten 4a. step
  • This reply was modified 7 years, 8 months ago by ul.
  • This reply was modified 7 years, 8 months ago by ul.