samuelthomas2774 / nxapi

Nintendo Switch Online/Parental Controls app APIs. Show your Nintendo Switch presence in Discord, get friend notifications on desktop, and download and access SplatNet 2, NookLink, SplatNet 3 and Parental Controls data. Mirror of https://gitlab.fancy.org.uk/samuel/nxapi.git.
GNU Affero General Public License v3.0
413 stars 34 forks source link

Nintendo Switch Online app v2.2.0 (26/07/2022) #14

Closed samuelthomas2774 closed 1 year ago

samuelthomas2774 commented 1 year ago

Release notes (https://www.nintendo.co.uk/-1520024.html):

  • You can now send friend requests via friend code.
    • Users must use a Nintendo Switch console to respond to friend requests.
  • You can now copy your friend code as a URL and/or save it as a QR Code. You can receive friend requests from anyone with whom you share the URL or QR Code.
  • Various issues are now resolved.
  • Changed minimum OS version.
    • iOS version 14.0 or later is required to use this application.
In-app announcement (iOS):
> Thank you for using the Nintendo Switch Online app. > > You can now update the app to Ver. 2.2.0. > > Please see below for a list of version changes. > > - You can now send friend requests via friend code. > Note: Users must use a Nintendo Switch console to respond to friend requests. > - You can now copy your friend code as a URL and/or save it as a QR Code. You can receive friend requests from anyone with whom you share the URL or QR Code. > - Various other small changes have also been made. > > --- > > We hope you continue to enjoy the Nintendo Switch Online app. > ```json > { > "announcementId": 111, > "priority": 0, > "forceDisplayEndDate": 253402300799, > "distributionDate": 1658887200, > "title": "Ver. 2.2.0 update announcement", > "description": "Thank you for using the Nintendo Switch Online app.\r\n \r\nYou can now update the app to Ver. 2.2.0.\r\n\r\nPlease see below for a list of version changes.\r\n \r\n- You can now send friend requests via friend code.\r\n Note: Users must use a Nintendo Switch console to respond to friend requests.\r\n- You can now copy your friend code as a URL and/or save it as a QR Code. You can receive friend requests from anyone with whom you share the URL or QR Code.\r\n- Various other small changes have also been made.\r\n \r\n---\r\n \r\nWe hope you continue to enjoy the Nintendo Switch Online app." > } > ```
In-app announcement (Android):
> Thank you for using the Nintendo Switch Online app. > > You can now update the app to Ver. 2.2.0. > > Please see below for a list of version changes. > > - You can now send friend requests via friend code. > Note: Users must use a Nintendo Switch console to respond to friend requests. > - You can now copy your friend code as a URL and/or save it as a QR Code. You can receive friend requests from anyone with whom you share the URL or QR Code. > - Various other small changes have also been made. > > --- > > We hope you continue to enjoy the Nintendo Switch Online app. > ```json > { > "announcementId": 112, > "priority": 0, > "forceDisplayEndDate": 253402300799, > "distributionDate": 1658887200, > "title": "Ver. 2.2.0 update announcement", > "description": "Thank you for using the Nintendo Switch Online app.\r\n \r\nYou can now update the app to Ver. 2.2.0.\r\n\r\nPlease see below for a list of version changes.\r\n \r\n- You can now send friend requests via friend code.\r\n Note: Users must use a Nintendo Switch console to respond to friend requests.\r\n- You can now copy your friend code as a URL and/or save it as a QR Code. You can receive friend requests from anyone with whom you share the URL or QR Code.\r\n- Various other small changes have also been made.\r\n \r\n---\r\n \r\nWe hope you continue to enjoy the Nintendo Switch Online app." > } > ```

Both announcements are exactly the same..

Users must use a Nintendo Switch console to respond to friend requests.

This is not strictly true - sending a friend request to a user who has sent you a friend request will add them as a friend immediately, it's just not possible to actually view received friend requests using the app.

Other changes:

No breaking/behaviour API changes have been made (see 1st comment on new endpoints for friend requests). f tokens generated with v2.0.0 are still accepted.


https://github.com/samuelthomas2774/nintendo-app-versions works :). Changes to the Nintendo Switch Online and Nintendo Switch Parental Controls apps on iTunes, Google Play and Nintendo EU/JP will be pushed to this repository automatically. Join Discord to enable notifications for the #nintendo-app-versions channel.

samuelthomas2774 commented 1 year ago

Sharing friend code:

When sharing as a QR code, the app appends ?via=qr to the URL before creating a QR code.

I'm not sure what the friendCodeHash is a hash of/how it's calculated, or if it's even a hash of anything. (It's very short, and it seems to be possible for it to use any alphanumeric characters, so it's not base64-encoded.) I don't know what purpose it serves either, as the URL includes the user's friend code anyway, it just seems to restrict generating this link to the API (the app doesn't appear to be able to generate it).


Sending a friend request by entering a friend code:

The app then shows a modal with the target user's name, image and friend code and a send friend request button.

Pressing the send friend request button:

The app stores recently sent friend requests locally (requestedAt, userName, friendCode, userImageUrl), on Android using the FriendRequestHistory shared preference key.

Friends requests sent using Coral appear as "sent via your friend code"/"by exchanging friend codes" on a Nintendo Switch console, although it's possible to send a friend request using Coral without the recipient's friend code, as it's only used to retrieve their network account ID.


Sending a friend request using a link:

The app shows the target user and sends friend requests the same as if the friend code was entered manually.

samuelthomas2774 commented 1 year ago

New web service JavaScript APIs:

/**
 * Unknown.
 * I guess it just opens the QR code reader? But it doesn't appear to have any new options,
 * and must just use the same close function as the other openQRCodeReader* functions.
 * A new `window.onQRCodeReadForCheckin` function is called, I assume on completion of
 * this action.
 */
function openQRCodeReaderForCheckin(/** JSON.stringify(data: QRCheckinOption) */ data: string): void;

interface QRCheckinOption {
    source: 'Camera' | 'PhotoLibrary';
}

/**
 * Download images and save the image to the photo library.
 */
function downloadImages(/** JSON.stringify(data: DownloadImageParam) */ imagesJson: string): void;

interface DownloadImageParam {
    image_urls: string[];
}

/**
 * Report the web service is ready to show and hide the loading screen.
 * Web services with the `fullScreen` attribute set to `"true"` must call this function.
 */
function completeLoading(): void;

/**
 * Close the web view.
 * Web services with the `fullScreen` attribute set to `"true"` must have an option that calls
 * this function somewhere to allow the user to exit the web service. (This is also available
 * to non-fullscreen web services.)
 */
function closeWebView(): void;

/**
 * Unknown.
 * SplatNet 3 has unused translation strings for widgets. This function may be used to
 * ask any native app extensions to look for new data (where?).
 */
function reloadExtension(): void;
samuelthomas2774 commented 1 year ago

As of 29/07/2022 v2.2.0 is required for /v3/Account/Login.