Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @interface VIGP2API()
- {
- AnGooGeneralCallbackBlock _callBack;
- }
- @property AnGooGeneralCallbackBlock PushMsgCallbackBlock;
- @end
- static TIAESCipher *_sgAesEngineObj = nil;
- @implementation VIGP2API
- @synthesize PushMsgCallbackBlock = _callBack;
- + (VIGP2API*)objectForV2AuthLoginWithTag:(NSInteger)tag
- account:(NSString*)account
- passwd:(NSString*)passwd
- deviceID:(NSString*)deviceID
- deviceCreateTime:(NSNumber*)deviceCreateTime
- deviceType:(NSString*)deviceType
- deviceBrand:(NSString*)deviceBrand
- deviceOsVersion:(NSString*)deviceOsVersion
- completion:(AnGooGeneralCallbackBlock)block
- {
- NSDictionary *args = @{@"account":NotNilString(account),
- @"password":EncryString(NotNilString(passwd)),
- @"deviceId":NotNilString(deviceID),
- @"deviceCreateTime":deviceCreateTime,
- @"deviceType":NotNilString(deviceType),
- @"deviceBrand":NotNilString(deviceBrand),
- @"deviceOsVersion":NotNilString(deviceOsVersion)};
- VIGP2API *retObj = [[VIGP2API alloc]initWithArgs:args
- tag:tag
- trustHosts:TruckHosts
- completion:^(id selfObj, NSInteger tag, id data, NSError *error)
- {
- logExceptionWithFunc(error);
- logf(data);
- VIGP2API *WsApiObj = (VIGP2API*)selfObj;
- AnGooGeneralCallbackBlock aBlock = WsApiObj.PushMsgCallbackBlock;
- if(aBlock != nil) {
- aBlock(selfObj, tag, data, error);
- }
- }];
- [retObj setPushMsgCallbackBlock:block];
- NSURLRequest *urlR = [retObj genURLRequestWithUrlString:[NSString stringWithFormat:@"%@/auth/login", GetLuxgenVIGP2Url] args:args];
- [retObj excuteURLRequest:urlR timeoutInSeconds:TimeoutSec];
- return retObj;
- }
- ...
- @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement