Archive

[Roubit] ๊ฐœ๋ฐœ์ผ์ง€

์•ˆ๋‹คํฌ 2020. 2. 25. 14:59
728x90

https://github.com/wmcmahan/react-native-calendar-events

 

wmcmahan/react-native-calendar-events

๐Ÿ“† React Native Module for iOS and Android Calendar Events - wmcmahan/react-native-calendar-events

github.com

 

react-native link react-native-calendar-events

ํ–ˆ์Œ

 

https://github.com/wmcmahan/react-native-calendar-events/wiki/iOS-setup

info.plist ์ถ”๊ฐ€ํ•˜๋‹ˆ ๊ถŒํ•œ ์š”์ฒญํ•  ๋•Œ ํฌ๋ž˜์‹œ ์‚ฌ๋ผ์ง.

 

๊ทธ๋ƒฅ.... ์•Œ๋žŒ์€.... ์ปค์Šคํ…€์ด์—ˆ๋˜๊ฑฐ๋‹ค.

 

yarn add react-native-push-notification

https://www.npmjs.com/package/react-native-push-notification

 

react-native-push-notification

React Native Local and Remote Notifications

www.npmjs.com

 

์„ค์น˜ ์ญ‰ ๋”ฐ๋ผ๊ฐ€๊ณ , firebase๋Š” remote๋ฅผ ์•ˆ์“ธ๊ฑฐ๋‹ˆ๊นŒ firebase ๋‚˜์˜ค๋Š” ๋ถ€๋ถ„์€ ๋‹ค ์Šคํ‚ตํ–ˆ์Œ.

์•ˆ๋“œ, ios ๋ชจ๋‘ local noti ์˜ค๋Š”๊ฑฐ ํ™•์ธ!

 

๊ทผ๋ฐ ์•ˆ๋“œ๋Š” ์™œ์ด๋ ‡๊ฒŒ ์•Œ๋žŒ์ด ๊ณ„์† ์˜ค์ง€?

 

์ด์ œ nfc ์Šค์บ” ์‹œ ์•Œ๋žŒ์ด ๊บผ์ง€๋„๋ก ํ•ด๋ณด์ž.

 

์ผ๋‹จ nfc ์Šค์บ”ํ•˜๋Š” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์ฐพ์•„๋ด์•ผ์ง€

 

https://www.npmjs.com/package/react-native-nfc-manager

 

react-native-nfc-manager

A NFC module for react native.

www.npmjs.com

 

https://coding-dahee.tistory.com/127

 

[React Native] NFC ์Šค์บ”

https://www.npmjs.com/package/react-native-nfc-manager react-native-nfc-manager A NFC module for react native. www.npmjs.com

coding-dahee.tistory.com

์ฐธ๊ณ 

 

https://github.com/hansemannn/iOS-NFC-Example

์—์„œ Provisioning Profile entitled with the NFC Tag Reading capability: ๋‹ค์Œ๋ถ€ํ„ฐ๋Š” ์•ˆํ•จ

 

 

[ํ‘ธ์‹œ ์•Œ๋ฆผ ์‚ฌ์šฉ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ]

https://github.com/zo0r/react-native-push-notification

 

 

[๋ฒ„๊ทธ ํ•ด๊ฒฐ]

https://coding-dahee.tistory.com/131

 

[React Native] react-native-push-notification local notification ์•ˆ๋“œ๋กœ์ด๋“œ ์•Œ๋žŒ์ด ๋ฉˆ์ถ”์ง€ ์•Š์„ ๋•Œ

- ์‚ฌ์šฉ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ https://github.com/zo0r/react-native-push-notification - ํ™˜๊ฒฝ RN 0.61.5 - ๋ฒ„๊ทธ ์•ˆ๋“œ๋กœ์ด๋“œ ์„ค์น˜ ๋”ฐ๋ผํ•˜๊ณ , local notification์„ ์‹คํ–‰์‹œ์ผœ ๋ดค๋Š”๋ฐ, ์•Œ๋ฆผ์ด ๋ฉˆ์ถ”์ง€ ์•Š๊ณ  ๊ณ„์† ์™”๋‹ค. Android..

coding-dahee.tistory.com

 

[floating button]

https://github.com/mastermoo/react-native-action-button

 

mastermoo/react-native-action-button

customizable multi-action-button component for react-native - mastermoo/react-native-action-button

github.com

 

docker ๊น”๊ธฐ

๋กœ๊ทธ์ธ

daheeahn

deg9810@gmail.com

์ƒํƒœ๋ฐ”์—์„œ ๋กœ๊ทธ์ธ

 

yarn

npx prisma2 init

prisma/.env ๋ถ™์—ฌ๋„ฃ๊ธฐ

# Environment variables declared in this file are automatically made available to Prisma.
# See the documentation for more detail: https://pris.ly/d/prisma-schema#using-environment-variables

# Prisma supports the native connection string format for PostgreSQL, MySQL and SQLite.
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings

DATABASE_URL="postgresql://testuser:testpasswd@localhost:5432/testdb?schema=public"

prisma2/schema.prisma ๋ถ™์—ฌ๋„ฃ๊ธฐ

// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

generator client {
  provider = "prisma-client-js"
}

enum Sex {
  male female
}

enum Provider {
  kakao
}

model User {
  id          Int         @id @default(autoincrement())
  nickname    String
  birthdate   DateTime
  sex         Sex
  userPushId  String?
  userAccount UserAccount
  createdAt   DateTime    @default(now())
  updatedAt   DateTime    @updatedAt
  deletedAt   DateTime?

  @@unique([userPushId, userAccount])
}

model UserAccount {
  id        Int       @id @default(autoincrement())
  snsId     String    @unique
  provider  Provider
  user      User?
  createdAt DateTime  @default(now())
  updatedAt DateTime  @updatedAt
  deletedAt DateTime?
}

model Nfc {
  id        Int        @id @default(autoincrement())
  value     String     @unique
  userNfc   User_nfc[]
  createdAt DateTime   @default(now())
  updatedAt DateTime   @updatedAt
  deletedAt DateTime?
}

model Routine {
  id             Int              @id @default(autoincrement())
  name           String
  user           User
  userNfcRoutine User_nfc_routine
  createdAt      DateTime         @default(now())
  updatedAt      DateTime         @updatedAt
  deletedAt      DateTime?
}

model Alarm {
  id        Int       @id @default(autoincrement())
  name      String
  createdAt DateTime  @default(now())
  updatedAt DateTime  @updatedAt
  deletedAt DateTime?
}

model Result {
  id              Int               @id @default(autoincrement())
  date            DateTime
  userNfcUser     User_nfc_routine
  resultTimestamp Result_timestamp?
  createdAt       DateTime          @default(now())
  updatedAt       DateTime          @updatedAt
  deletedAt       DateTime?
}

model Result_timestamp {
  id           Int       @id @default(autoincrement())
  firstTagging DateTime
  lastTagging  DateTime
  result       Result
  createdAt    DateTime  @default(now())
  updatedAt    DateTime  @updatedAt
  deletedAt    DateTime?
}

model User_nfc {
  id          Int               @id @default(autoincrement())
  description String
  user        User
  nfc         Nfc
  nfcRoutine  User_nfc_routine?
  createdAt   DateTime          @default(now())
  updatedAt   DateTime          @updatedAt
  deletedAt   DateTime?
}

model User_nfc_routine {
  id        Int       @id @default(autoincrement())
  daysArray String
  fromTime  DateTime
  endTime   DateTime
  userNfc   User_nfc
  result    Result[]
  routine   Routine
  createdAt DateTime  @default(now())
  updatedAt DateTime  @updatedAt
  deletedAt DateTime?
}

model User_nfc_alaram {
  id        Int       @id @default(autoincrement())
  createdAt DateTime  @default(now())
  updatedAt DateTime  @updatedAt
  deletedAt DateTime?
}

๊ทธ๋Ÿฐ๋ฐ ์Šคํ‚ค๋งˆ ๋ฐ”๋€”๋•Œ๋งˆ๋‹ค ํ’€๋ฐ›์•„์•ผํ•˜๋‹ˆ๊นŒ ์ด๊ฑฐ ๋ถ€๋ถ„์€ prisma ํด๋” ๋ถ€๋ถ„์€ ๋‹ค์‹œ ์•Œ์•„๋ณธ๋Œ€!

 

 

yarn build

docker-compose up -d // db์„œ๋ฒ„ ๋„์›Œ์คŒ.

 

npx prisma2 migrate save --name 'name' --experimental

npx prisma2 migrate up --experimental

yarn dev

 

accout ๋จผ์ € ์ƒ์„ฑํ•ด์•ผํ•จ

mutation {
  createOneUserAccount(data:{snsId: "edit here", provider:kakao}) {
    id
  }
}
mutation {
  createOneUser(
    data: { nickname: "daheeahn", birthdate:  "2017-11-25T23:55:35.116Z", sex: female, userAccount:{connect:{id: 1}} }
  ) {
    id
    nickname
  }
}

 

 

studio graphql-yoga๋กœ ์จ๋ณด๊ธฐ

 

์ด์Šˆ ์˜ฌ๋ ค๋†จ๋‹ค

 

https://github.com/zo0r/react-native-push-notification/issues/1342

 

how not to disappear push notification when gesture sideways · Issue #1342 · zo0r/react-native-push-notification

If I click the push notification and it does not disappear, I can control it with autoCancel. But how do I make sure that I don't disappear even if I gesture sideways? Is there a function like ...

github.com

 

nfc๋ฅผ ํƒœ๊ทธํ•˜๋ฉด ์•ฑ์„ ์‹คํ–‰์‹œ์ผœ์•ผ ํ•œ๋‹ค!

https://coding-dahee.tistory.com/144

 

[Android/React Native] NFC ํƒœ๊ทธ ์‹œ ์•ˆ๋“œ๋กœ์ด๋“œ ์•ฑ/์–ดํ”Œ ์‹คํ–‰์‹œํ‚ค๋Š” ๋ฐฉ๋ฒ•

๊ฒฐ๊ณผ์ ์œผ๋กœ๋Š” https://github.com/observ3r/nfc-ndef-react-native ์— ์žˆ๋Š” android ์ฝ”๋“œ๋ฅผ ์‚ฌ์šฉํ–ˆ๋”๋‹ˆ ๋๋‹ค! (๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์„ค์น˜ ์—†์ด) 1) android/app/src/main/AndroidManifest.xml ์— ๋‹ค์Œ ๊ถŒํ•œ ์ถ”๊ฐ€ <uses-perm..< p=""> </uses-perm..<>

coding-dahee.tistory.com

์„ฑ๊ณต

 

 

- iOS ์•Œ๋žŒ

์•ฑ์ด ์•„์˜ˆ ๊บผ์กŒ์„ ๋• ์•Œ๋žŒ์„ 1๋ฒˆ๋ฐ–์— ๋ชป์šธ๋ฆฐ๋‹ค. ์•ฑ์„ ์ผœ๊ธฐ ์ „๊นŒ์ง€ local push๋ฅผ ๋ฐ˜๋ณต์ ์œผ๋กœ ๋ณด๋‚ด๋Š” ๋ฐฉ๋ฒ•๋ฐ–์— ์—†๋Š”๋ฐ, ์–ด๋–ป๊ฒŒ ํ• ๊นŒ?

๋ฐฑ๊ทธ๋ผ์šด๋“œ์— ์žˆ์„ ๋• ์•ฑ์„ ์‹คํ–‰ํ•˜๋Š” ๊ฒƒ์ด ๊ฐ€๋Šฅํ•œ ๊ฒƒ ๊ฐ™์Œ.

 

- ๋ฃจํ‹ด ์•Œ๋žŒ ๋ง๊ณ  ๊ทธ๋ƒฅ ์•Œ๋žŒ๋ถ€ํ„ฐ ํ•˜์ž!

** ๋กœ์ปฌ ์Šคํ† ๋ฆฌ์ง€์— ์ €์žฅ๋˜๋Š”๊ฑธ๋กœ!

 

1. ์•ฑ ์•„์˜ˆ ์ข…๋ฃŒ ์‹œ ์•Œ๋žŒ

- ๋ฐ˜๋ณต์ ์œผ๋กœ ๋ณด๋‚ผ๊ฑด๊ฐ€, ๊ทธ๋Ÿฌ๋ฉด ์•Œ๋žŒ์ด ์—ฌ๋Ÿฌ๊ฐœ ์•Œ๋ฆผ๋ฐ”์— ๋‚จ๋Š”๊ฒŒ ๋˜๋ฉด ์•ˆ๋จ

- ์•„๋‹ˆ๋ฉด ๊ทธ๋ƒฅ ํ•˜๋ฉด๋จ.

2. ๋ฐฑ๊ทธ๋ผ์šด๋“œ ์•Œ๋žŒ

3. ํฌ๊ทธ๋ผ์šด๋“œ ์•Œ๋žŒ

์•Œ๋žŒ์ด ์žˆ์œผ

 

- ์บ˜๋ฆฐ๋”๋Š” ์ง์ ‘ ๋งŒ๋“ค์ž.

 

- ์บ˜๋ฆฐ๋” ๋ณต์‚ฌ ๋ฅผ ์œ„ํ•ด hover๋ฅผ ์•Œ์•„๋ดค๋Š”๋ฐ

https://codesandbox.io/s/o9q8vy70l5

 

์ด๋Ÿฐ ๊ณณ์ด ์žˆ๊ธด ํ•˜์ง€๋งŒ ์Œ... ์ผ๋‹จ ํฌ๊ธฐ! ๋‚˜์ค‘์— ์•Œ์•„๋ณด์ž!

 

3/27 ์ผ

- LongPressGestureHandler ์ด์šฉใ…‡ํ•˜๋ฉด ๊พน ๋ˆŒ๋ €์„ ๋•Œ๋งŒ ํ™œ์„ฑํ™”๋˜๋Š” ์–ด๋–ค๊ฑธ ํ•  ์ˆ˜๋„ ์žˆ๊ฒ ๋‹ค!

renderLeft์ฒ˜๋Ÿผ ์œ„๋กœ ์˜ฌ๋ฆฌ๋Š” ์ œ์Šค์ฒ˜๋„ ์žˆ๋‚˜?

 

 

 

4/16 ๋ชฉ

 

identityToken ์„ ํ•ด๋…ํ•˜๋ฉด user๊ฐ€ ๋‚˜์˜ค๋Š”๋ฐ ๊ทธ๊ฑฐ ๊ฐ€์ง€๊ณ  ์„œ๋ฒ„์—์„œ db์— ์žˆ๋Š”์ง€ ํ™•์ธํ•˜๊ณ  jwtํ† ํฐ ๋งŒ๋“ค์–ด์ค˜.

๊ทธ jwt ํ† ํฐ ๊ฐ€์ง€๊ณ  ๋‚ด๊ฐ€ ์š”์ฒญ๋ณด๋‚ผ ๋•Œ ๋งˆ๋‹ค ํ—ค๋”์— ๋ณด๋‚ด์ฃผ๋ฉด ๋จ.

 

kakao๋Š” api๊ฐ€ ๋”ฐ๋กœ ์žˆ์–ด์„œ

accessToken๊ฐ€์ง€๊ณ  api ๋•Œ๋ฆฌ๋ฉด ์œ ์ € ์ •๋ณด ์ค€๋‹ค.

 

v2/user/me

ํ•˜๋ฉด

์œ ์ €์ •๋ณด ์ซ™ ๋‚˜์˜ด

 

๊ตฌ๊ธ€๋„ token์„ ์ฃผ๋Š”๋ฐ ๊ทธ๊ฑฐ ํ•ด๋…ํ•œ๋‹ค์Œ์— ์ด๋ฉ”์ผ์ด unique ๊ฐ’์ด๋‹ˆ๊นŒ ๊ทธ๊ฑธ๋กœ db์— ์žˆ๋Š”์ง€ ์ฐพ๊ณ  jwt token ๋งŒ๋“ค์–ด์„œ ์ค€๋‹ค.

 

์ถœ์ฒ˜: https://mingos-habitat.tistory.com/34 [๋ฐ๊ณ ์˜์„œ์‹์ง€:ํ‹ฐ์Šคํ† ๋ฆฌ]