question

newuser-e071b10b-45ef-46d6-881a-0fb15f49cc15 avatar image

Legacy DRS login not working

I just follow the DRS tutorial and trying below code but not working, Is anything wrong in the below code?

private func launchLogin() {

let manager = AMZNAuthorizationManager.shared()

let request = AMZNAuthorizeRequest()

request.interactiveStrategy = .auto

var scopeObjectArray = [AMZNScope]()

let requestScopes = "dash:replenish";

var options = [String : Any]()

options["serial"] = "123456"

options["device_model"] = "Device_Name_Test"

options["should_include_non_live"] = true

options["is_test_device"] = true

let drsScope = AMZNScopeFactory.scope(withName: requestScopes, data: options)

let profileScope = AMZNProfileScope.profile()

scopeObjectArray.append(drsScope)

scopeObjectArray.append(profileScope)

request.scopes = scopeObjectArray

request.grantType = .code


request.codeChallenge = "U3DddAEJMGgEc-ovgkgp571_atqjX0UjfMXA5QRT-XM"

request.codeChallengeMethod = "S256"


manager.authorize(request, withHandler: requestDRSHandler)

}

Getting below error,

Domain=AMZNLWAErrorDomain Code=6 "(null)" UserInfo={AMZNLWAErrorNonLocalizedDescription=One or more input parameters are wrong.}

Looks like the issue with the backend, can someone help?

dash replenishment service
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

KirkC@Amazon avatar image
KirkC@Amazon answered

Hello, legacy DRS has been deprecated and as such, developers can only create legacy DRS devices if they already have pre-existing legacy devices.

We would encourage anyone interested in Dash Replenishment to instead use the following Dash Replenishment documentation:
https://developer.amazon.com/docs/dash/dash-replenishment-overview.html

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.