Adil
09/26/2024, 12:36 PM// SWIFT
val deviceID = 116170158
*let* deviceIdData = withUnsafeBytes(of: &deviceId) { Data($0) }
print("PAYLOAD",formattedString)
output:
[174, 157, 236, 6]
// KOTLIN
val deviceID = 116170158
val deviceIdData = ByteBuffer.allocate(Int.SIZE_BYTES)
.order(ByteOrder._LITTLE_ENDIAN_)
.putInt(deviceId.toInt())
.array()
_print_("PAYLOAD BYTEARRY: ${Arrays.toString(payload)}")
output:
[-82, -99, -20, 6]
Sam
09/26/2024, 1:00 PMSam
09/26/2024, 1:02 PMUByteArray
firstSam
09/26/2024, 1:02 PMAdil
09/26/2024, 1:27 PM