Commit 306ea6b
fix(android): use ReactApplicationContext instead of getCurrentActivity in initialize and sendTokenToIntercom (#432)
getCurrentActivity() can return null when JS execution starts before the
Activity is fully attached, causing intermittent "Activity is null" promise
rejections. ReactApplicationContext is always available when a @ReactMethod
is invoked, so getApplicationContext() on it is the correct way to obtain
an Application reference.
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>1 parent 3a0d01b commit 306ea6b
2 files changed
Lines changed: 14 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
134 | 127 | | |
135 | 128 | | |
136 | 129 | | |
| |||
616 | 609 | | |
617 | 610 | | |
618 | 611 | | |
619 | | - | |
620 | | - | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
626 | 615 | | |
627 | 616 | | |
628 | 617 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
111 | 105 | | |
112 | 106 | | |
113 | 107 | | |
| |||
593 | 587 | | |
594 | 588 | | |
595 | 589 | | |
596 | | - | |
597 | | - | |
598 | | - | |
599 | | - | |
600 | | - | |
601 | | - | |
602 | | - | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
603 | 593 | | |
604 | 594 | | |
605 | 595 | | |
| |||
0 commit comments