최근에 내 앱에 사용하기 위해 바인딩하려는 iOS SDK가 수신되었습니다. .a 파일, ApiDefinitions.cs 클래스를 만든 .h 파일이 있고 모든 것이 빌드됩니다. 하지만 런타임에 어떤 메서드 나 속성을 호출하려고해도이 코드와 같은 오류가 발생합니다 "Neolane_SDK에 잘못된 IL 코드가 있습니다. RegisterDevice (Foundation.NSData, string, Foundation.NSDictionary) : IL_0043 : stloc.s 4 "Xamarin.iOS 런타임에 프로젝트 바인딩 오류가 발생했습니다.
네이티브 iOS 응용 프로그램에서도 사용되기 때문에 라이브러리 자체가 예상대로 작동하고 있음을 알고 있습니다. Binding 프로젝트 구성에서 누락 된 부분을 파악하려고합니다.
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
//the tag id dedicated to the opening of an app following a notification
#define NL_TRACK_CLICK @"2"
@interface Neolane_SDK : NSObject {
}
// marketingHost is the hostname of the Neolane marketing instance (i.e. host.neolane.org)
@property (strong, nonatomic) NSString *marketingHost;
// trackingHost is the hostname of the Neolane tracking instance (i.e. tracking.neolane.org)
@property (strong, nonatomic) NSString *trackingHost;
// integrationKey is the integration key as confgured in your Neolane instance
@property (strong, nonatomic) NSString *integrationKey;
// The connection timout in second (default 30.0 seconds)
@property (nonatomic) double requestTimeout;
// Get the Neolane_SDK instance
+ (Neolane_SDK *) getInstance;
// Register a device in the Neolane instance
// @param token the token as received from the didRegisterForRemoteNotificationsWithDeviceToken callback.
// @param userKey the user identifier
// @param additionalParams custom additional parameters
- (void) registerDevice:(NSData *) token :(NSString *) userKey :(NSDictionary *) additionalParams;
// Notify Neolane of the opening of a push message
// @param deliveryId is the Neolane delivery identifier, as received in the push message
// @param broadlogId is the Neolane broadlog identifier, as received in the push message
// @param tagId tag identifier in Neolane server (NL_TRACK_CLICK when opening an app following a notification).
- (void) track:(NSString *) deliveryId :(NSString *) broadlogId :(NSString *) tagId;
// Send tracking information to Neolane
// @param launchOptions object received by the application before the opening of the application
// @param tagId tag identifier in Neolane server (NL_TRACK_CLICK when opening an app following a notification)
- (void) track:(NSDictionary *) launchOptions :(NSString *) tagId;
void displayOptions(NSDictionary * launchOptions);
@end
을 그리고 여기에 C#을 관련 샤피로 만든 인터페이스 : 미소 : 여기
내 .A 라이브러리와 관련된 .H 파일 소스입니다에도 불구하고// @interface Neolane_SDK : NSObject
[BaseType(typeof(NSObject))]
interface Neolane_SDK
{
// @property (nonatomic, strong) NSString * marketingHost;
[Export("marketingHost", ArgumentSemantic.Strong)]
string MarketingHost { get; set; }
// @property (nonatomic, strong) NSString * trackingHost;
[Export("trackingHost", ArgumentSemantic.Strong)]
string TrackingHost { get; set; }
// @property (nonatomic, strong) NSString * integrationKey;
[Export("integrationKey", ArgumentSemantic.Strong)]
string IntegrationKey { get; set; }
// @property (nonatomic) double requestTimeout;
[Export("requestTimeout")]
double RequestTimeout { get; set; }
// +(Neolane_SDK *)getInstance;
[Static]
[Export("getInstance")]
Neolane_SDK Instance { get; }
// -(void)registerDevice:(NSData *)token :(NSString *)userKey :(NSDictionary *)additionalParams;
[Export("registerDevice:::")]
void RegisterDevice(NSData token, string userKey, NSDictionary additionalParams);
// -(void)track:(NSString *)deliveryId :(NSString *)broadlogId :(NSString *)tagId;
[Export("track:::")]
void Track(string deliveryId, string broadlogId, string tagId);
// -(void)track:(NSDictionary *)launchOptions :(NSString *)tagId;
[Export("track::")]
void Track(NSDictionary launchOptions, string tagId);
}
, 여기 내 .a 파일에 대한 LinkWith 옵션
[assembly: LinkWith("libNeolane_SDK.a", SmartLink = true, ForceLoad = true)]
모든 도움/피드백/경험이 감사합니다 :)
감사합니다.
답장을 보내 주셔서 감사합니다. 그거였다 ! – Miiite