Zebra Scanner SDK for iOS

HoomanYazdiHoomanYazdi USMember ✭✭

Hi,

I am creating a binding project for Zebra Scanner SDK. The binding project compiles with no error but when I create an instance of it in my project, it's null. Any idea why??????????????

Here is the SDK Help link.
https://atgsupportcentral.motorolasolutions.com/content/emb/docs/manuals/MN001834A01a.pdf

Here is the code

SbtSdkFactory.h

#import <Foundation/Foundation.h>
#import "ISbtSdkApi.h"

@interface SbtSdkFactory : NSObject

+(id<ISbtSdkApi>)createSbtSdkApiInstance;

@end

ApiDefinition.cs

    [BaseType (typeof(NSObject))]
    interface SbtSdkFactory
    {
        // +(id<ISbtSdkApi>)createSbtSdkApiInstance;
        [Static]
        [Export ("createSbtSdkApiInstance")]
        [Abstract]
        ISbtSdkApi CreateSbtSdkApiInstance { get; }
        //ISbtSdkApi CreateSbtSdkApiInstance();
    }

Usage

var myApi = SbtSdkFactory.CreateSbtSdkApiInstance;

The problem is myApi is null after running above code. Any idea where the problem is?

Answers

  • HoomanYazdiHoomanYazdi USMember ✭✭

    I have attached the SDK Binding Project here.

  • joehannajoehanna AUBeta ✭✭

    Hi @HoomanYazdi

    Did you ever get this resolved? I am having the same problem now. Any help would be appreciated.

    Joe

  • RidhwanRRidhwanR GBMember ✭✭

    @joehanna @HoomanYazdi Did you guys figure this out?

  • lalitbokdelalitbokde USMember ✭✭

    Hello Hooman , Have you solved this null issue? if yes will you please help what you changed in ApiDefinition.

  • joehannajoehanna AUBeta ✭✭

    I never got this to work. I lost the contract - but I have another one coming up and really need to get this going.

    @JohnMiller Can you help with this? Is it maybe something @redth can help with too?

  • valdeterovaldetero USInsider, University ✭✭

    I'm in the process of doing this now. I have it mostly done, but am not 100% happy with it. @joehanna are you still working on it?

  • valdeterovaldetero USInsider, University ✭✭

    @HoomanYazdi I don't think you should have the [Abstract] attribute on it.

  • valdeterovaldetero USInsider, University ✭✭

    Anyone else that comes here, check out the binding that I have on github: https://github.com/Envoc/ZebraSDK. Suggestions or recommendations are welcomed.

  • valdetero - I am looking at the same thing, same time - what a coincidence! I had a look at your GitHub and it looks very similar to what I extracted for myself. A couple of questions - how do you actually make a call to a binding library - for instance to just get a version? Second question is why you have a delegate interface empty? Sharpie created one which seemed to have some definitions...
    HoomanYazdi - were you eventually successful with making calls to the Sdk?

  • StephenHewisonStephenHewison USMember ✭✭

    I've made some progress with this by following these steps:

    Add the objective sharpie code to the binding project and build.

    Find the generated *.g.cs files in the build output directory. Add these files to the binding project and rename to *.cs.

    Empty the ApiDefinitions file. Create a new file called Enums.cs and move the Structs and Enums to this file, then empty the original file.

    Refactor the Messaging class to be ZebraMessaging.

    Modify the CreateSbtSdkApiInstance method of the SbtSdkFactory to create an instance of ISbtSdkApiWrapper but return the type of the IISbtSdkApi interface.

    Then in your app project use the IISbtSdkApi interface.

Sign In or Register to comment.