Skip to content

Commit

Permalink
Fixed issue with game events when recording in multi-threaded environ…
Browse files Browse the repository at this point in the history
…ment

Removed obsolete code
Added bundleId to init call
  • Loading branch information
TrevenNefta committed Apr 16, 2024
1 parent 0743cde commit 15880e8
Show file tree
Hide file tree
Showing 31 changed files with 2,813 additions and 3,992 deletions.
8 changes: 4 additions & 4 deletions Assets/Nefta/Adapter.cs
Expand Up @@ -25,7 +25,7 @@ public class Adapter
private static extern void NeftaPlugin_Record(IntPtr instance, string recordedEvent);

[DllImport ("__Internal")]
private static extern string NeftaPlugin_ShowNuid(IntPtr instance);
private static extern string NeftaPlugin_GetNuid(IntPtr instance, bool present);

private static IntPtr _plugin;
#elif UNITY_ANDROID
Expand Down Expand Up @@ -115,14 +115,14 @@ public static void Record(GameEvent gameEvent)
#endif
}

public static string ShowNuid()
public static string GetNuid(bool present)
{
string nuid = null;
#if UNITY_EDITOR
#elif UNITY_IOS
nuid = NeftaPlugin_ShowNuid(_plugin);
nuid = NeftaPlugin_GetNuid(_plugin, present);
#elif UNITY_ANDROID
nuid = _plugin.Call<string>("ShowNuid");
nuid = _plugin.Call<string>("GetNuid", present);
#endif
return nuid;
}
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion Assets/Nefta/Plugins/iOS/ISNeftaCustomAdapter.m
Expand Up @@ -164,7 +164,7 @@ - (NSString *) networkSDKVersion {
}

- (NSString *) adapterVersion {
return @"1.2.7";
return @"1.2.8";
}

+ (void)ApplyRenderer:(UIViewController *)viewController {
Expand Down
6 changes: 3 additions & 3 deletions Assets/Nefta/Plugins/iOS/NeftaAdapter.m
Expand Up @@ -8,7 +8,7 @@
void EnableLogging(bool enable);
void * NeftaPlugin_Init(const char *appId);
void NeftaPlugin_Record(void *instance, const char *event);
const char * NeftaPlugin_ShowNuid(void *instance);
const char * NeftaPlugin_GetNuid(void *instance, bool present);
#ifdef __cplusplus
}
#endif
Expand All @@ -28,8 +28,8 @@ void NeftaPlugin_Record(void *instance, const char *event) {
[_plugin RecordWithEvent: [NSString stringWithUTF8String: event]];
}

const char * NeftaPlugin_ShowNuid(void *instance) {
const char *string = [[_plugin ShowNuid] UTF8String];
const char * NeftaPlugin_GetNuid(void *instance, bool present) {
const char *string = [[_plugin GetNuidWithPresent: present] UTF8String];
char *returnString = (char *)malloc(strlen(string) + 1);
strcpy(returnString, string);
return returnString;
Expand Down
18 changes: 0 additions & 18 deletions Assets/Nefta/Plugins/iOS/NeftaIsAdapter.h

This file was deleted.

27 changes: 0 additions & 27 deletions Assets/Nefta/Plugins/iOS/NeftaIsAdapter.h.meta

This file was deleted.

2 changes: 1 addition & 1 deletion Assets/Nefta/Plugins/iOS/NeftaSDK.xcframework/Info.plist
Expand Up @@ -41,7 +41,7 @@
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>Version</key>
<string>3.2.7</string>
<string>3.2.8</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
Expand Down
Expand Up @@ -454,9 +454,6 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, copy) void (^ _Nullable OnLog)
@property (nonatomic, copy) void (^ _Nullable IOnReward)(NSString * _Nonnull);
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
- (NSString * _Nullable)GetToolboxUser SWIFT_WARN_UNUSED_RESULT;
- (void)SetToolboxUserWithJson:(NSString * _Nonnull)json;
- (void)SetCustomBatchSize:(NSInteger)newBatchSize;
- (void)RecordWithEvent:(NSString * _Nonnull)event;
- (void)EnableAds:(BOOL)enable;
- (void)EnableBannerWithEnable:(BOOL)enable;
Expand All @@ -476,7 +473,7 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, copy) void (^ _Nullable OnLog)
- (void)Close;
- (void)CloseWithId:(NSString * _Nonnull)id;
- (void)Mute:(BOOL)mute;
- (NSString * _Nonnull)ShowNuid SWIFT_WARN_UNUSED_RESULT;
- (NSString * _Nonnull)GetNuidWithPresent:(BOOL)present SWIFT_WARN_UNUSED_RESULT;
- (UIView * _Nullable)GetViewForPlacement:(Placement * _Nonnull)placement show:(BOOL)show SWIFT_WARN_UNUSED_RESULT;
@end

Expand Down

0 comments on commit 15880e8

Please sign in to comment.