swarmcity / SwarmCityConcept

This is the high level description of what needs to be built
9 stars 1 forks source link

As a user I get notified, so I can quickly navigate to the actionnable items. #30

Open kikipluche opened 6 years ago

kikipluche commented 6 years ago

Abstract:

Swarm City makes it easy for users to interact with Ethereum, without them knowing it.

Most of the navigation is done through the notification list. Users are only prompted to interact with it when there are actionable items.

How it could work:

A list of notifications is kept on a user's client. The API stores new incoming notifications until they are delivered to the client.

A notification has a timestamp, avatarhash, username, description, a click-through link, and a status.

Status options are "unread", "read", or "archived".

A notification's status changes after the user leaves the notification view from "unread" to "read".

Read notifications are shown for 24hrs, and after that moved to an "archive" list.

From the archive list, a user can delete their notifications.

Notifications are not encrypted, as they only serve to notify publicly visible transactions / actions.

Chat notifications will not show specific content. Example:

{    
    'type': 'B', // A=Account, B=Wallet, C=Deal, D=Chat
    'operation': 'add', // add, remove, update'
    'copy': '+12 SWT received'
    'link': '/my-wallet',
    'dateTime': dateTime,
    'avatarhash': avatarhash,
    'username': 'Kiki Pluche',
    'status': 'unread', // unread, read, archived,
}

Spam prevention: Notifications can only be sent / received in empty slots the clients create when they "expect" a notification. All other incoming notifications will be ignored.

Triggers for Notifications

In general we only send a notification for actions the user did not trigger themself. The notifications are divided into types/categories:

A) ACCOUNT-notification These notifications all link to /my-profile/ on click.

B) WALLET-notification: These notifications all link to /my-wallet/ on click.

C) DEALS-notifications: These notifications all link to the relevant deal on click.

D) CHAT-notifications These notifications all link to the relevant chat view on click.

How the API could work:

New notifications are stored on the API with the user's address as a unique key. When the client connects, the notifications are updated in LocalStorage. When the notification is delivered to the client, it is removed from the API.

API Category: Messaging

Subscription UserNotification Parameters deviceId address

Returns the new notification list

Event userNotificationChanged

Returns the new notification listitem


What it looks like:

Userflow: https://invis.io/ABGM89SX3V5#/300150129_-Hashtag--contractaddress-_ACCOUNT_NOTIF-Flow_I ( > in Invision, hold shift to see clickable areas)


When a notification is received, the user will see the notification-icon next to his avatar (bottom right corner). The notification-icon has 2 appearances:

Tapping the icon itself will lead to the notifications-view (the notifications-view can also be accessed by tapping the notifications-button on /my-profile/).

On the notifications-view, the user sees:

An unread notification consists of:

An read notification consists of the same things, with two exceptions:

Tapping the black X-mark will send the user back to where he came from. Tapping one of the notifications will lead to where the action is that this notification describes.

In the example the notification "Brenda reacted to your request “A ride to the coffee shop on 3th and Grand Av anyone?”." will lead to the deal “A ride to the coffee shop on 3th and Grand Av anyone?”.

Tapping the "see archive" button will lead to the notifications-archive-view.

The notifications-archive-view consists of:

Tapping the back-arrow-icon will lead the user back to the notifications-view. Tapping the delete-icon will remove this notification from the archive.

Exact copy for each notification:


Desktop view:


Invisionlinks with login (for inspect mode!): mobile: https://projects.invisionapp.com/d/main#/console/13838256/300150129/inspect desktop: https://projects.invisionapp.com/d/main#/console/14147648/300150058/inspect

Documentation / references


With ♡ from Swarm City