[cuurentTag queryNDEFStatusWithCompletionHandler:^(NFCNDEFStatus status, NSUInteger capacity, NSError * _Nullable error) {
if (status != NFCNDEFStatusReadWrite) {
[weakSelf invalidateSessionWitgMsg:@"NFC无法写入" success:NO];
return;
}
NSMutableArray *nfcArray = [NSMutableArray arrayWithCapacity:2];
{
NSString *type = @"android.com:pkg";
NSData *typeData = [type dataUsingEncoding:NSUTF8StringEncoding];
NSString *identifier = @"qwe";
NSData *identifierData = [identifier dataUsingEncoding:NSUTF8StringEncoding];
NSString *payloadStr = @"com.tencent.mm";
NSData *payloadData = [payloadStr dataUsingEncoding:NSUTF8StringEncoding];
NFCNDEFPayload *NDEFPayload = [[NFCNDEFPayload alloc] initWithFormat:NFCTypeNameFormatNFCExternal type:typeData identifier:identifierData payload:payloadData];
[nfcArray addObject:NDEFPayload];
}
{
NSString *type = @"U";
NSData *typeData = [type dataUsingEncoding:NSUTF8StringEncoding];
NSString *identifier = @"qwe";
NSData *identifierData = [identifier dataUsingEncoding:NSUTF8StringEncoding];
NSString *payloadStr = @"-weixin://dl/business/?t=xxxxxx";
NSData *payloadData = [payloadStr dataUsingEncoding:NSUTF8StringEncoding];
NFCNDEFPayload *NDEFPayload = [[NFCNDEFPayload alloc] initWithFormat:NFCTypeNameFormatNFCWellKnown type:typeData identifier:identifierData payload:payloadData];
[nfcArray addObject:NDEFPayload];
}
NFCNDEFMessage *message = [[NFCNDEFMessage alloc] initWithNDEFRecords:nfcArray];
[cuurentTag writeNDEF:message completionHandler:^(NSError * _Nullable error) {
NSString *msg = error?@"NFC写入失败":@"NFC写入成功";
[weakSelf invalidateSessionWitgMsg:msg success:error==nil];
}];
}];
你好,麻烦在手机微信那里上传下日志: 我->设置->帮助与反馈右上角有个上报日志的入口,麻烦提供一下微信号,时间点
您好 请问您是怎么申请 nfc的设备model_id 咋填的 我填了审核过不了