2

Google has introduced Play Integrity for device verification.

It uses nonce as an input string. There is no sample on how to generate nonce. There are few blogs like these but there is no example for that can works at production level.

Dhruv Kaushal
  • 632
  • 8
  • 17

1 Answers1

2

Answering my own question: Generate Nonce like this

    var nonceBytes = ByteArray(40) //you can change the length
    SecureRandom().nextBytes(nonceBytes)  //randomise the bytes
    var nonce = Base64.encodeToString(nonceBytes,  Base64.URL_SAFE)

Hope this helps.

Dhruv Kaushal
  • 632
  • 8
  • 17