Commit 8f2a376
authored
fix: voip token not able to be got if user switched (#1683)
### Overview
Consider this scenario where as soon as app is opened. User A logged in
and then immediately logged off and then user B logs in.
```
1. user A logs in
2. useEffect registers listeners to listen for push
3. user A logs out immediately - listeners are removed
4. apple sends push token now , but SDK is not listening as no user is logged in
5. user B logs in
6. useEffect registers listeners to listen for push
7. apple DOES NOT SEND push token now because it was sent earlier
```
### Implementation notes
If we look at the voip notification library, if we call
registerVoipToken() method, the library sends the JS event for new push
token with the last push token that it received.
Now after this in point 7 we will receive a event in JS saying that it
received a push token1 parent 3bd3096 commit 8f2a376
File tree
1 file changed
+23
-2
lines changed- packages/react-native-sdk/src/hooks/push
1 file changed
+23
-2
lines changedLines changed: 23 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
97 | 103 | | |
98 | 104 | | |
99 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
100 | 110 | | |
101 | 111 | | |
102 | 112 | | |
| |||
112 | 122 | | |
113 | 123 | | |
114 | 124 | | |
115 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
116 | 129 | | |
117 | 130 | | |
118 | 131 | | |
119 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
120 | 136 | | |
121 | 137 | | |
122 | 138 | | |
| |||
145 | 161 | | |
146 | 162 | | |
147 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
148 | 169 | | |
149 | 170 | | |
150 | 171 | | |
| |||
0 commit comments