iOS
3. Basic Login
This login is done by calling Goodie.setLogin() function. This function will retrieve based on the deviceUniqueId, username, password, merchantCode. Login to Goodie System to access Goodie Feature.
Here is example:
1. GoodieCore.login(deviceUniqueId: "deviceUniqueId", username: "username", password: "password", merchantCode: "merchantCode", completion: { (LoginResponse) in 2. if LoginResponse.abstractResponse?.responseStatus == "AUTH000" { 3. //success, do something 4. }else{ 5. //failed 6. } 7. }) { (Error) in 8. //error 9. }
Where :
Param | Type | Description |
---|---|---|
deviceUniqueId | String | deviceUniqueId is identify android device |
username | String | username is used as a login member to sdk goodie |
password | String | password is used as for authentication purpose |
merchantCode | String | merchantCode is identifier that will be used to identity a merchant |
Response login :
1. { 2. "authToken": "703DE269-397A-4FE2-9958-D7C5C2753A99", 3. "authDevice": "deviceId", 4. "expiryTime": "2019-06-21_08:23:43", 5. "memberId": "D0A57818-1351-463D-9AD0-8A593250A68F", 6. "merchantId": "5F773EA1-1E66-4F9E-B9C8-E1FA8156AD20", 7. "merchantName": null, 8. "userPic": null, 9. "firstName": "anadia", 10. "lastName": "salsabella", 11. "phoneNumber": null, 12. "gender": "", 13. "birthDate": "", 14. "status": -1, 15. "qrImage": null, 16. "abstractResponse": { 17. "responseStatus": "AUTH000", 18. "responseMessage": "Authentication success" 19. }, 20. "merchantType": 2 21. }