ping-identity
    Preparing search index...

    Function getNumbersChallenge

    • Parses the raw numbersChallenge string from a PushNotification into an array of numbers.

      Both native SDKs expose this as an instance method on their PushNotification types. This standalone function avoids class complexity and works with the plain object shape returned over the bridge.

      Parameters

      Returns number[]

      An array of parsed integers, or an empty array if numbersChallenge is null, undefined, or an empty string.

      Never — invalid entries in the CSV string are filtered out silently.

      const numbers = getNumbersChallenge(notification);
      // notification.numbersChallenge = '12,34,56'
      // => [12, 34, 56]

      const empty = getNumbersChallenge({ ...notification, numbersChallenge: null });
      // => []