@gphone/sdk
    Preparing search index...

    Function useDeepLink

    • OS Service Hook for acting on the props a deep link opened this app with.

      Three apps had written the same effect, and the same paragraph explaining it, because the rule it encodes is not guessable. Apps stay resident, so:

      • It cannot be mount-time work. Mount runs once per session, so a second tap on the camera thumbnail would be ignored.
      • It has to consume the props. They are still set when the user presses back, so an unconsumed link re-fires and the back button looks dead.
      • It has to be able to wait. On a cold open the list has not arrived yet, so the link must survive until the data it names exists.

      handle returns whether it acted. Returning false leaves the props in place to be tried again on the next change — which is what makes the third rule work — and true clears them.

      useDeepLink('media', () => {
      if (initialPhoto) { selectedPhoto = initialPhoto; return true; }
      const found = initialPhotoId && $photos.find((p) => p.id === initialPhotoId);
      if (!found) return false; // not loaded yet — ask again when it is
      selectedPhoto = found;
      return true;
      });

      Parameters

      • appId: string
      • handle: () => boolean

      Returns void