This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSDictionary *jsonDataTobeEncode = @{@"sub":@"123456",@"name":@"Premal",@"admin": @true}; | |
NSString *jwtTokenValue = [JWTBuilder encodePayload:jsonDataTobeEncode].secret(@"SecretKey").algorithm([JWTAlgorithmFactory algorithmByName:@"HS256"]).encode; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I am using the library to generate the token for the data. Every time i run the app and it crash and give me following error | |
-[NSConcreteData base64UrlEncodedString]: unrecognized selector sent to instance 0x7fa9ba8145b0 | |
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSConcreteData base64UrlEncodedString]: unrecognized selector sent to instance 0x7fa9ba8145b0' | |
I put debug points and found that in the JWT.m file there is method named** - (NSString )encodeSegment:(id)theSegment withError:(NSError *)error **. In this method there is the code as below | |
`NSString *encodedSegment = nil; |