Closed nashfive closed 5 years ago
Hi @stoprocent, I want to be able to monitor (scan) Eddystone regions by providing only the regions' namespaceId so I try to add regions like so:
NSMutableArray<KTKEddystoneRegion *> * namespaces = [NSMutableArray array]; NSArray * args = (NSArray *)call.arguments[@"namespaces"] ?: @[]; for (NSDictionary * namespaceDict in args) { NSString * namespaceId = namespaceDict[@"namespaceId"]; NSString * instanceId = namespaceDict[@"instanceId"]; KTKEddystoneRegion * region; if (namespaceId != nil && instanceId != nil) { region = [[KTKEddystoneRegion alloc] initWithNamespaceID:namespaceId instanceID:instanceId]; } else if (namespaceId != nil) { region = [[KTKEddystoneRegion alloc] initWithNamespaceID:namespaceId]; } else { // Eddystone region can't have only an instanceId continue; } [namespaces addObject:region]; }
The problem is that the scan doesn't produce anything.
This works perfectly with the Android SDK. Can you elaborate why?
Oh sorry, I think it was due to an error in my code: namespaceDict[@"instanceId"] was giving me a NSNull object instead of nil.
namespaceDict[@"instanceId"]
NSNull
nil
Hi @stoprocent, I want to be able to monitor (scan) Eddystone regions by providing only the regions' namespaceId so I try to add regions like so:
The problem is that the scan doesn't produce anything.
This works perfectly with the Android SDK. Can you elaborate why?