feeddo-react-native 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +401 -2
  3. package/android/build.gradle +39 -0
  4. package/android/src/main/AndroidManifest.xml +1 -0
  5. package/android/src/main/java/dev/feeddo/reactnative/FeeddoReactNativeModule.java +380 -0
  6. package/android/src/main/java/dev/feeddo/reactnative/FeeddoReactNativePackage.java +25 -0
  7. package/dist/Feeddo.d.ts +131 -0
  8. package/dist/Feeddo.d.ts.map +1 -0
  9. package/dist/Feeddo.js +176 -0
  10. package/dist/Feeddo.js.map +1 -0
  11. package/dist/FeeddoClient.d.ts +151 -0
  12. package/dist/FeeddoClient.d.ts.map +1 -0
  13. package/dist/FeeddoClient.js +690 -0
  14. package/dist/FeeddoClient.js.map +1 -0
  15. package/dist/FeeddoProvider.d.ts +23 -0
  16. package/dist/FeeddoProvider.d.ts.map +1 -0
  17. package/dist/FeeddoProvider.js +76 -0
  18. package/dist/FeeddoProvider.js.map +1 -0
  19. package/dist/config/FeeddoConfig.d.ts +10 -0
  20. package/dist/config/FeeddoConfig.d.ts.map +1 -0
  21. package/dist/config/FeeddoConfig.js +10 -0
  22. package/dist/config/FeeddoConfig.js.map +1 -0
  23. package/dist/index.d.ts +36 -0
  24. package/dist/index.d.ts.map +1 -0
  25. package/dist/index.js +38 -0
  26. package/dist/index.js.map +1 -0
  27. package/dist/models/Conversation.d.ts +27 -0
  28. package/dist/models/Conversation.d.ts.map +1 -0
  29. package/dist/models/Conversation.js +24 -0
  30. package/dist/models/Conversation.js.map +1 -0
  31. package/dist/models/EndUser.d.ts +49 -0
  32. package/dist/models/EndUser.d.ts.map +1 -0
  33. package/dist/models/EndUser.js +2 -0
  34. package/dist/models/EndUser.js.map +1 -0
  35. package/dist/models/FeeddoNotification.d.ts +15 -0
  36. package/dist/models/FeeddoNotification.d.ts.map +1 -0
  37. package/dist/models/FeeddoNotification.js +15 -0
  38. package/dist/models/FeeddoNotification.js.map +1 -0
  39. package/dist/models/HomeData.d.ts +16 -0
  40. package/dist/models/HomeData.d.ts.map +1 -0
  41. package/dist/models/HomeData.js +19 -0
  42. package/dist/models/HomeData.js.map +1 -0
  43. package/dist/models/Message.d.ts +12 -0
  44. package/dist/models/Message.d.ts.map +1 -0
  45. package/dist/models/Message.js +25 -0
  46. package/dist/models/Message.js.map +1 -0
  47. package/dist/models/PushProvider.d.ts +14 -0
  48. package/dist/models/PushProvider.d.ts.map +1 -0
  49. package/dist/models/PushProvider.js +9 -0
  50. package/dist/models/PushProvider.js.map +1 -0
  51. package/dist/models/Task.d.ts +17 -0
  52. package/dist/models/Task.d.ts.map +1 -0
  53. package/dist/models/Task.js +22 -0
  54. package/dist/models/Task.js.map +1 -0
  55. package/dist/models/TaskComment.d.ts +11 -0
  56. package/dist/models/TaskComment.d.ts.map +1 -0
  57. package/dist/models/TaskComment.js +27 -0
  58. package/dist/models/TaskComment.js.map +1 -0
  59. package/dist/models/Ticket.d.ts +13 -0
  60. package/dist/models/Ticket.d.ts.map +1 -0
  61. package/dist/models/Ticket.js +14 -0
  62. package/dist/models/Ticket.js.map +1 -0
  63. package/dist/native/FeeddoNative.d.ts +58 -0
  64. package/dist/native/FeeddoNative.d.ts.map +1 -0
  65. package/dist/native/FeeddoNative.js +22 -0
  66. package/dist/native/FeeddoNative.js.map +1 -0
  67. package/dist/push/FeeddoPushNotificationApns.d.ts +73 -0
  68. package/dist/push/FeeddoPushNotificationApns.d.ts.map +1 -0
  69. package/dist/push/FeeddoPushNotificationApns.js +301 -0
  70. package/dist/push/FeeddoPushNotificationApns.js.map +1 -0
  71. package/dist/services/ApiService.d.ts +64 -0
  72. package/dist/services/ApiService.d.ts.map +1 -0
  73. package/dist/services/ApiService.js +406 -0
  74. package/dist/services/ApiService.js.map +1 -0
  75. package/dist/services/ConversationService.d.ts +45 -0
  76. package/dist/services/ConversationService.d.ts.map +1 -0
  77. package/dist/services/ConversationService.js +259 -0
  78. package/dist/services/ConversationService.js.map +1 -0
  79. package/dist/services/WebSocketService.d.ts +26 -0
  80. package/dist/services/WebSocketService.d.ts.map +1 -0
  81. package/dist/services/WebSocketService.js +157 -0
  82. package/dist/services/WebSocketService.js.map +1 -0
  83. package/dist/theme/FeeddoTheme.d.ts +31 -0
  84. package/dist/theme/FeeddoTheme.d.ts.map +1 -0
  85. package/dist/theme/FeeddoTheme.js +60 -0
  86. package/dist/theme/FeeddoTheme.js.map +1 -0
  87. package/dist/ui/FeeddoFeedbackCard.d.ts +15 -0
  88. package/dist/ui/FeeddoFeedbackCard.d.ts.map +1 -0
  89. package/dist/ui/FeeddoFeedbackCard.js +188 -0
  90. package/dist/ui/FeeddoFeedbackCard.js.map +1 -0
  91. package/dist/ui/FeeddoModal.d.ts +20 -0
  92. package/dist/ui/FeeddoModal.d.ts.map +1 -0
  93. package/dist/ui/FeeddoModal.js +180 -0
  94. package/dist/ui/FeeddoModal.js.map +1 -0
  95. package/dist/ui/components/AttachmentPreview.d.ts +10 -0
  96. package/dist/ui/components/AttachmentPreview.d.ts.map +1 -0
  97. package/dist/ui/components/AttachmentPreview.js +143 -0
  98. package/dist/ui/components/AttachmentPreview.js.map +1 -0
  99. package/dist/ui/components/ChatInputArea.d.ts +16 -0
  100. package/dist/ui/components/ChatInputArea.d.ts.map +1 -0
  101. package/dist/ui/components/ChatInputArea.js +85 -0
  102. package/dist/ui/components/ChatInputArea.js.map +1 -0
  103. package/dist/ui/components/FeeddoIcon.d.ts +10 -0
  104. package/dist/ui/components/FeeddoIcon.d.ts.map +1 -0
  105. package/dist/ui/components/FeeddoIcon.js +690 -0
  106. package/dist/ui/components/FeeddoIcon.js.map +1 -0
  107. package/dist/ui/components/FeeddoNotificationBadge.d.ts +14 -0
  108. package/dist/ui/components/FeeddoNotificationBadge.d.ts.map +1 -0
  109. package/dist/ui/components/FeeddoNotificationBadge.js +171 -0
  110. package/dist/ui/components/FeeddoNotificationBadge.js.map +1 -0
  111. package/dist/ui/components/MessageBubble.d.ts +13 -0
  112. package/dist/ui/components/MessageBubble.d.ts.map +1 -0
  113. package/dist/ui/components/MessageBubble.js +163 -0
  114. package/dist/ui/components/MessageBubble.js.map +1 -0
  115. package/dist/ui/components/NotificationsSheet.d.ts +10 -0
  116. package/dist/ui/components/NotificationsSheet.d.ts.map +1 -0
  117. package/dist/ui/components/NotificationsSheet.js +252 -0
  118. package/dist/ui/components/NotificationsSheet.js.map +1 -0
  119. package/dist/ui/components/RatingWidget.d.ts +11 -0
  120. package/dist/ui/components/RatingWidget.d.ts.map +1 -0
  121. package/dist/ui/components/RatingWidget.js +34 -0
  122. package/dist/ui/components/RatingWidget.js.map +1 -0
  123. package/dist/ui/components/TaskCard.d.ts +12 -0
  124. package/dist/ui/components/TaskCard.d.ts.map +1 -0
  125. package/dist/ui/components/TaskCard.js +210 -0
  126. package/dist/ui/components/TaskCard.js.map +1 -0
  127. package/dist/ui/components/TaskDetailsSheet.d.ts +15 -0
  128. package/dist/ui/components/TaskDetailsSheet.d.ts.map +1 -0
  129. package/dist/ui/components/TaskDetailsSheet.js +577 -0
  130. package/dist/ui/components/TaskDetailsSheet.js.map +1 -0
  131. package/dist/ui/components/TicketCard.d.ts +11 -0
  132. package/dist/ui/components/TicketCard.d.ts.map +1 -0
  133. package/dist/ui/components/TicketCard.js +100 -0
  134. package/dist/ui/components/TicketCard.js.map +1 -0
  135. package/dist/ui/components/TicketDetailsSheet.d.ts +14 -0
  136. package/dist/ui/components/TicketDetailsSheet.d.ts.map +1 -0
  137. package/dist/ui/components/TicketDetailsSheet.js +254 -0
  138. package/dist/ui/components/TicketDetailsSheet.js.map +1 -0
  139. package/dist/ui/components/TypingIndicator.d.ts +10 -0
  140. package/dist/ui/components/TypingIndicator.d.ts.map +1 -0
  141. package/dist/ui/components/TypingIndicator.js +77 -0
  142. package/dist/ui/components/TypingIndicator.js.map +1 -0
  143. package/dist/ui/screens/FeeddoChatScreen.d.ts +13 -0
  144. package/dist/ui/screens/FeeddoChatScreen.d.ts.map +1 -0
  145. package/dist/ui/screens/FeeddoChatScreen.js +681 -0
  146. package/dist/ui/screens/FeeddoChatScreen.js.map +1 -0
  147. package/dist/ui/screens/FeeddoHomeScreen.d.ts +15 -0
  148. package/dist/ui/screens/FeeddoHomeScreen.d.ts.map +1 -0
  149. package/dist/ui/screens/FeeddoHomeScreen.js +653 -0
  150. package/dist/ui/screens/FeeddoHomeScreen.js.map +1 -0
  151. package/dist/ui/screens/FeeddoMessagesScreen.d.ts +12 -0
  152. package/dist/ui/screens/FeeddoMessagesScreen.d.ts.map +1 -0
  153. package/dist/ui/screens/FeeddoMessagesScreen.js +326 -0
  154. package/dist/ui/screens/FeeddoMessagesScreen.js.map +1 -0
  155. package/dist/ui/screens/FeeddoTasksScreen.d.ts +13 -0
  156. package/dist/ui/screens/FeeddoTasksScreen.d.ts.map +1 -0
  157. package/dist/ui/screens/FeeddoTasksScreen.js +517 -0
  158. package/dist/ui/screens/FeeddoTasksScreen.js.map +1 -0
  159. package/dist/ui/screens/FeeddoTicketsScreen.d.ts +10 -0
  160. package/dist/ui/screens/FeeddoTicketsScreen.d.ts.map +1 -0
  161. package/dist/ui/screens/FeeddoTicketsScreen.js +112 -0
  162. package/dist/ui/screens/FeeddoTicketsScreen.js.map +1 -0
  163. package/dist/utils/DeviceInfoHelper.d.ts +29 -0
  164. package/dist/utils/DeviceInfoHelper.d.ts.map +1 -0
  165. package/dist/utils/DeviceInfoHelper.js +190 -0
  166. package/dist/utils/DeviceInfoHelper.js.map +1 -0
  167. package/dist/utils/MediaHelper.d.ts +20 -0
  168. package/dist/utils/MediaHelper.d.ts.map +1 -0
  169. package/dist/utils/MediaHelper.js +92 -0
  170. package/dist/utils/MediaHelper.js.map +1 -0
  171. package/dist/utils/NotificationSupport.d.ts +22 -0
  172. package/dist/utils/NotificationSupport.d.ts.map +1 -0
  173. package/dist/utils/NotificationSupport.js +211 -0
  174. package/dist/utils/NotificationSupport.js.map +1 -0
  175. package/dist/utils/StorageHelper.d.ts +65 -0
  176. package/dist/utils/StorageHelper.d.ts.map +1 -0
  177. package/dist/utils/StorageHelper.js +273 -0
  178. package/dist/utils/StorageHelper.js.map +1 -0
  179. package/feeddo-react-native.podspec +26 -0
  180. package/ios/FeeddoReactNativeModule.h +8 -0
  181. package/ios/FeeddoReactNativeModule.m +831 -0
  182. package/package.json +56 -4
  183. package/src/Feeddo.ts +247 -0
  184. package/src/FeeddoClient.ts +895 -0
  185. package/src/FeeddoProvider.tsx +139 -0
  186. package/src/config/FeeddoConfig.ts +9 -0
  187. package/src/index.ts +67 -0
  188. package/src/models/Conversation.ts +50 -0
  189. package/src/models/EndUser.ts +65 -0
  190. package/src/models/FeeddoNotification.ts +29 -0
  191. package/src/models/HomeData.ts +33 -0
  192. package/src/models/Message.ts +36 -0
  193. package/src/models/PushProvider.ts +15 -0
  194. package/src/models/Task.ts +40 -0
  195. package/src/models/TaskComment.ts +36 -0
  196. package/src/models/Ticket.ts +25 -0
  197. package/src/native/FeeddoNative.ts +80 -0
  198. package/src/push/FeeddoPushNotificationApns.ts +362 -0
  199. package/src/services/ApiService.ts +456 -0
  200. package/src/services/ConversationService.ts +305 -0
  201. package/src/services/WebSocketService.ts +185 -0
  202. package/src/theme/FeeddoTheme.ts +85 -0
  203. package/src/ui/FeeddoFeedbackCard.tsx +245 -0
  204. package/src/ui/FeeddoModal.tsx +309 -0
  205. package/src/ui/components/AttachmentPreview.tsx +192 -0
  206. package/src/ui/components/ChatInputArea.tsx +154 -0
  207. package/src/ui/components/FeeddoIcon.tsx +903 -0
  208. package/src/ui/components/FeeddoNotificationBadge.tsx +234 -0
  209. package/src/ui/components/MessageBubble.tsx +223 -0
  210. package/src/ui/components/NotificationsSheet.tsx +324 -0
  211. package/src/ui/components/RatingWidget.tsx +64 -0
  212. package/src/ui/components/TaskCard.tsx +259 -0
  213. package/src/ui/components/TaskDetailsSheet.tsx +747 -0
  214. package/src/ui/components/TicketCard.tsx +128 -0
  215. package/src/ui/components/TicketDetailsSheet.tsx +324 -0
  216. package/src/ui/components/TypingIndicator.tsx +104 -0
  217. package/src/ui/screens/FeeddoChatScreen.tsx +877 -0
  218. package/src/ui/screens/FeeddoHomeScreen.tsx +824 -0
  219. package/src/ui/screens/FeeddoMessagesScreen.tsx +414 -0
  220. package/src/ui/screens/FeeddoTasksScreen.tsx +671 -0
  221. package/src/ui/screens/FeeddoTicketsScreen.tsx +164 -0
  222. package/src/utils/DeviceInfoHelper.ts +209 -0
  223. package/src/utils/MediaHelper.ts +105 -0
  224. package/src/utils/NotificationSupport.ts +233 -0
  225. package/src/utils/StorageHelper.ts +305 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Feeddo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,402 @@
1
- # Temporary Holding Version
1
+ # Feeddo React Native SDK
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Drop a live AI support chat into your React Native (iOS & Android) app with just a few lines of code.
4
+
5
+ ## What is Feeddo?
6
+
7
+ Feeddo is an AI-powered customer support widget for your React Native app. Being the premier **Intercom alternative for React Native**, Feeddo provides a native, lightweight, and AI-first experience:
8
+
9
+ - 🤖 **AI Agent** - Handles simple questions instantly by reading your docs and FAQs
10
+ - 🎫 **Auto-creates support tickets** - Gracefully escalates to tickets when the AI cannot resolve the issue
11
+ - 💬 **Live chat** - Real-time WebSocket messaging with image & video attachment support
12
+ - 🐛 **Smart bug tracking** - Auto-detects and structures bug reports directly into actionable issues
13
+ - 💡 **Feature requests** - Captures, organizes, and prioritizes feature requests from users
14
+ - 🗳️ **Community board** - Users can browse, upvote, and comment (with attachments) on feature requests and reported bugs
15
+ - 🔔 **Push Notifications** - Direct iOS APNs (built-in, zero AppDelegate boilerplate) and Firebase Cloud Messaging (FCM) support with interactive in-app banners and deep-linking
16
+
17
+ ---
18
+
19
+ ## Screenshots
20
+
21
+ ### 1. Simple & Clean Home
22
+ Your users get a clean dashboard to manage their conversations and tickets.
23
+
24
+ <p align="center">
25
+ <img src="https://raw.githubusercontent.com/feeddo-support/feeddo_flutter/341da25d67f3a9a7d0d845ceab7145942859746e/screenshots/Home.png" height="500" alt="Home Screen" />
26
+ </p>
27
+
28
+ ### 2. AI Support Agent
29
+ If a user asks how to do something, the AI agent searches your docs and answers instantly.
30
+
31
+ <p align="center">
32
+ <img src="https://raw.githubusercontent.com/feeddo-support/feeddo_flutter/341da25d67f3a9a7d0d845ceab7145942859746e/screenshots/chat_example1.png" height="500" alt="AI Chat Answer" />
33
+ </p>
34
+
35
+ ### 3. Smart Bug Reporting
36
+ If a user reports a bug, the agent automatically gathers details and creates a bug report for you.
37
+
38
+ <p align="center">
39
+ <img src="https://raw.githubusercontent.com/feeddo-support/feeddo_flutter/341da25d67f3a9a7d0d845ceab7145942859746e/screenshots/chatexample2.png" height="500" alt="Bug Report Conversation" />
40
+ &nbsp;&nbsp;&nbsp;
41
+ <img src="https://raw.githubusercontent.com/feeddo-support/feeddo_flutter/341da25d67f3a9a7d0d845ceab7145942859746e/screenshots/chat_example3.png" height="500" alt="Bug Ticket Created" />
42
+ </p>
43
+
44
+ ### 4. Community Board
45
+ Other users can see feature requests and reported bugs, upvote them, and add comments.
46
+
47
+ <p align="center">
48
+ <img src="https://raw.githubusercontent.com/feeddo-support/feeddo_flutter/341da25d67f3a9a7d0d845ceab7145942859746e/screenshots/community_board.png" height="500" alt="Community Board" />
49
+ </p>
50
+
51
+ ---
52
+
53
+ ## Installation
54
+
55
+ ```bash
56
+ # Using npm
57
+ npm install feeddo-react-native @react-native-async-storage/async-storage
58
+
59
+ # Using yarn
60
+ yarn add feeddo-react-native @react-native-async-storage/async-storage
61
+ ```
62
+
63
+ ### Platform Setup (iOS & Android)
64
+
65
+ #### iOS Setup
66
+
67
+ 1. Install iOS pods (autolinks native device info, image picker, video player, and APNs bridge):
68
+ ```bash
69
+ cd ios && pod install && cd ..
70
+ ```
71
+ 2. Ensure your minimum deployment target in `ios/Podfile` is **iOS 13.4** or higher (iOS 15.0 recommended).
72
+ 3. If your app uses image attachments from the photo library, add `NSPhotoLibraryUsageDescription` to `ios/YourApp/Info.plist`:
73
+ ```xml
74
+ <key>NSPhotoLibraryUsageDescription</key>
75
+ <string>We allow you to attach screenshots and photos to support messages.</string>
76
+ ```
77
+
78
+ #### Android Setup
79
+
80
+ 1. Ensure `minSdkVersion` is `21` or higher in `android/build.gradle`.
81
+ 2. Ensure the Internet permission is present in `android/app/src/main/AndroidManifest.xml`:
82
+ ```xml
83
+ <uses-permission android:name="android.permission.INTERNET" />
84
+ ```
85
+
86
+ ---
87
+
88
+ ## Quick Start
89
+
90
+ ### 1. Get Your API Key
91
+
92
+ Sign up at [feeddo.dev](https://feeddo.dev) and grab your API key from the dashboard.
93
+
94
+ ### 2. Wrap Your App in `FeeddoProvider`
95
+
96
+ Place `FeeddoProvider` at the root of your React Native component tree. This hosts the Feeddo modal navigation stack and queued in-app slide notifications:
97
+
98
+ ```tsx
99
+ import React from 'react';
100
+ import { FeeddoProvider } from 'feeddo-react-native';
101
+ import AppNavigation from './AppNavigation';
102
+
103
+ export default function App() {
104
+ return (
105
+ <FeeddoProvider>
106
+ <AppNavigation />
107
+ </FeeddoProvider>
108
+ );
109
+ }
110
+ ```
111
+
112
+ ### 3. Initialize Feeddo
113
+
114
+ Call `Feeddo.init()` when your app starts (or after user authentication):
115
+
116
+ ```tsx
117
+ import { useEffect } from 'react';
118
+ import { Feeddo } from 'feeddo-react-native';
119
+
120
+ export function HomeScreen() {
121
+ useEffect(() => {
122
+ Feeddo.init({
123
+ apiKey: 'your-api-key-here',
124
+ externalUserId: 'user_12345', // Optional: link to your own user DB
125
+ userName: 'Jane Doe',
126
+ email: 'jane@example.com',
127
+ });
128
+ }, []);
129
+
130
+ return null;
131
+ }
132
+ ```
133
+
134
+ ### 4. Open Support or Community Board
135
+
136
+ ```tsx
137
+ import { TouchableOpacity, Text } from 'react-native';
138
+ import { Feeddo } from 'feeddo-react-native';
139
+
140
+ <TouchableOpacity onPress={() => Feeddo.show()}>
141
+ <Text>Get Help & Support</Text>
142
+ </TouchableOpacity>
143
+
144
+ <TouchableOpacity onPress={() => Feeddo.showCommunityBoard()}>
145
+ <Text>Request a feature</Text>
146
+ </TouchableOpacity>
147
+ ```
148
+
149
+ ---
150
+
151
+ ## Drop-in Feedback Card
152
+
153
+ Embed feedback or feature voting directly into your Settings or Profile screen using `FeeddoFeedbackCard`:
154
+
155
+ ```tsx
156
+ import { Feeddo, FeeddoFeedbackCard } from 'feeddo-react-native';
157
+
158
+ <FeeddoFeedbackCard
159
+ title="Need help or have an idea?"
160
+ description="Chat with our AI agent, report an issue, or request new features."
161
+ onChatPress={() => Feeddo.show()}
162
+ onBoardPress={() => Feeddo.showCommunityBoard()}
163
+ />
164
+ ```
165
+
166
+ ---
167
+
168
+ ## Understanding `Feeddo.init()`
169
+
170
+ ```tsx
171
+ const userId = await Feeddo.init({
172
+ // Required: Your API key from feeddo.dev
173
+ apiKey: 'fdo_your_api_key_here',
174
+
175
+ // Optional: Your app's user ID (links Feeddo to your system)
176
+ externalUserId: 'user_12345',
177
+
178
+ // Optional: User's display name (used in chats and comments)
179
+ userName: 'Jane Doe',
180
+
181
+ // Optional: User's email
182
+ email: 'jane@example.com',
183
+
184
+ // Optional: Segment your users (e.g., 'free', 'trial', 'enterprise')
185
+ userSegment: 'enterprise',
186
+
187
+ // Optional: Track subscription status
188
+ subscriptionStatus: 'active',
189
+
190
+ // Optional: Any arbitrary metadata to track
191
+ customAttributes: {
192
+ plan: 'pro',
193
+ signupDate: '2026-01-01',
194
+ teamSize: 12,
195
+ },
196
+
197
+ // Optional: Enable/disable in-app banner notifications (default: true)
198
+ isInAppNotificationOn: true,
199
+
200
+ // Optional: Theme for notifications
201
+ theme: FeeddoTheme.dark(),
202
+
203
+ // Optional: Duration in ms for in-app banner (default: 10000)
204
+ notificationDuration: 10000,
205
+
206
+ // Optional: Remote push token (APNs or FCM)
207
+ pushToken: 'device-push-token',
208
+
209
+ // Optional: Push provider ('fcm' | 'apns' | 'onesignal')
210
+ pushProvider: FeeddoPushProvider.fcm,
211
+ });
212
+ ```
213
+
214
+ **Returns:** The `userId` managed by Feeddo for this user.
215
+
216
+ ---
217
+
218
+ ## Push Notifications Setup (iOS & Android)
219
+
220
+ Push notifications ensure users receive developer replies, task progress, comments, and release announcements even when your app is backgrounded or closed.
221
+
222
+ ### Option A: iOS Direct APNs (`FeeddoPushNotificationApns` — Zero `AppDelegate` Code)
223
+
224
+ If your app targets iOS (or you want direct Apple APNs on iOS without Firebase), use the built-in `FeeddoPushNotificationApns` bridge:
225
+
226
+ 1. **Xcode Setup:** Enable **Push Notifications** in **Signing & Capabilities** (adds `aps-environment` to your `.entitlements`), and add `NSUserNotificationsUsageDescription` to `Info.plist`.
227
+ 2. **Initialize & Wire to Feeddo:**
228
+ ```tsx
229
+ import { useEffect } from 'react';
230
+ import {
231
+ Feeddo,
232
+ FeeddoPushProvider,
233
+ FeeddoPushNotificationApns,
234
+ } from 'feeddo-react-native';
235
+
236
+ useEffect(() => {
237
+ let sub: { cancel(): void } | undefined;
238
+
239
+ (async () => {
240
+ await FeeddoPushNotificationApns.instance.initialize();
241
+
242
+ await Feeddo.init({
243
+ apiKey: '<YOUR_FEEDDO_API_KEY>',
244
+ pushToken: FeeddoPushNotificationApns.instance.token ?? undefined,
245
+ pushProvider: FeeddoPushProvider.apns,
246
+ isInAppNotificationOn: true,
247
+ });
248
+
249
+ sub = FeeddoPushNotificationApns.instance.attachToFeeddo({
250
+ onToken: (token) =>
251
+ Feeddo.registerPushToken({
252
+ pushToken: token,
253
+ pushProvider: FeeddoPushProvider.apns,
254
+ }),
255
+ onNotificationTap: (payload) => Feeddo.handleNotificationTap(payload),
256
+ onForegroundNotification: (payload) =>
257
+ Feeddo.handleForegroundNotification(payload),
258
+ });
259
+ })();
260
+
261
+ return () => sub?.cancel();
262
+ }, []);
263
+ ```
264
+ 3. **Request Permission Contextually** (in Settings, Onboarding, or right when opening Support):
265
+ ```tsx
266
+ await FeeddoPushNotificationApns.instance.requestNotificationPermissions();
267
+ ```
268
+ 4. **Feeddo Server Setup:** In [feeddo.dev](https://feeddo.dev) → **Settings → Notifications → Apple (APNs)**, enter your Team ID, Key ID, Bundle ID (Topic), Environment (**Sandbox** for Debug/Simulator, **Production** for TestFlight/App Store), and upload your `.p8` key.
269
+
270
+ ### Option B: Cross-Platform iOS + Android (`@react-native-firebase/messaging`)
271
+
272
+ 1. In [Firebase Console](https://console.firebase.google.com/) → **Project Settings → Service accounts**, generate a private key (JSON) and upload it in [feeddo.dev](https://feeddo.dev) → **Settings → Notifications → Google (FCM)**.
273
+ 2. Wire Firebase Messaging handlers into Feeddo:
274
+
275
+ ```tsx
276
+ import messaging from '@react-native-firebase/messaging';
277
+ import { Feeddo, FeeddoPushProvider } from 'feeddo-react-native';
278
+
279
+ // 1. Request permission & register token
280
+ await messaging().requestPermission();
281
+ const token = await messaging().getToken();
282
+
283
+ await Feeddo.init({
284
+ apiKey: '<YOUR_FEEDDO_API_KEY>',
285
+ pushToken: token,
286
+ pushProvider: FeeddoPushProvider.fcm,
287
+ });
288
+
289
+ // 2. Token refresh listener
290
+ messaging().onTokenRefresh((newToken) => {
291
+ Feeddo.registerPushToken({
292
+ pushToken: newToken,
293
+ pushProvider: FeeddoPushProvider.fcm,
294
+ });
295
+ });
296
+
297
+ // 3. Notification opened from background
298
+ messaging().onNotificationOpenedApp((remoteMessage) => {
299
+ if (remoteMessage.data) {
300
+ Feeddo.handleNotificationTap(remoteMessage.data);
301
+ }
302
+ });
303
+
304
+ // 4. Notification opened from terminated state
305
+ messaging()
306
+ .getInitialNotification()
307
+ .then((remoteMessage) => {
308
+ if (remoteMessage?.data) {
309
+ Feeddo.handleNotificationTap(remoteMessage.data);
310
+ }
311
+ });
312
+
313
+ // 5. In-app banner for foreground notifications
314
+ messaging().onMessage(async (remoteMessage) => {
315
+ Feeddo.handleForegroundNotification(remoteMessage.data ?? {}, {
316
+ title: remoteMessage.notification?.title,
317
+ message: remoteMessage.notification?.body,
318
+ });
319
+ });
320
+ ```
321
+
322
+ ---
323
+
324
+ ## Customizing Themes & Colors
325
+
326
+ Feeddo includes Dark and Light themes, plus custom color overrides:
327
+
328
+ ```tsx
329
+ import { Feeddo, FeeddoTheme } from 'feeddo-react-native';
330
+
331
+ // Default Dark theme
332
+ Feeddo.show({ theme: FeeddoTheme.dark() });
333
+
334
+ // Light theme
335
+ Feeddo.show({ theme: FeeddoTheme.light() });
336
+
337
+ // Custom Brand Colors
338
+ const myTheme = new FeeddoTheme({
339
+ isDark: true,
340
+ colors: {
341
+ background: '#1A1A2E',
342
+ textPrimary: '#FFFFFF',
343
+ textSecondary: '#B0B0B0',
344
+ primary: '#00D9FF',
345
+ cardBackground: '#252540',
346
+ surface: '#252540',
347
+ appBarBackground: '#1A1A2E',
348
+ success: '#4CAF50',
349
+ error: '#FF5252',
350
+ border: '#3A3A5C',
351
+ divider: '#2A2A3E',
352
+ },
353
+ });
354
+
355
+ Feeddo.show({ theme: myTheme });
356
+ ```
357
+
358
+ ---
359
+
360
+ ## Unread Message Badge
361
+
362
+ ```tsx
363
+ import { useState, useEffect } from 'react';
364
+ import { View, Text } from 'react-native';
365
+ import { Feeddo } from 'feeddo-react-native';
366
+
367
+ export function SupportTabIcon() {
368
+ const [unread, setUnread] = useState(Feeddo.unreadMessageCount);
369
+
370
+ useEffect(() => {
371
+ return Feeddo.subscribeUnreadCount((count) => {
372
+ setUnread(count);
373
+ });
374
+ }, []);
375
+
376
+ return (
377
+ <View>
378
+ {unread > 0 && (
379
+ <View style={{ backgroundColor: '#EF4444', borderRadius: 10, paddingHorizontal: 6 }}>
380
+ <Text style={{ color: '#fff', fontSize: 12 }}>{unread}</Text>
381
+ </View>
382
+ )}
383
+ </View>
384
+ );
385
+ }
386
+ ```
387
+
388
+ ---
389
+
390
+ ## User Logout & Cleanup
391
+
392
+ When a user logs out of your app, call `Feeddo.dispose()` to reset SDK state, disconnect WebSockets, and clear active notifications:
393
+
394
+ ```tsx
395
+ Feeddo.dispose();
396
+ ```
397
+
398
+ ---
399
+
400
+ ## License
401
+
402
+ MIT License - see [LICENSE](./LICENSE) for details.
@@ -0,0 +1,39 @@
1
+ buildscript {
2
+ repositories {
3
+ google()
4
+ mavenCentral()
5
+ }
6
+ }
7
+
8
+ def safeExtGet(prop, fallback) {
9
+ rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
10
+ }
11
+
12
+ apply plugin: 'com.android.library'
13
+
14
+ android {
15
+ def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
16
+ if (agpVersion.tokenize('.')[0].toInteger() >= 7) {
17
+ namespace "dev.feeddo.reactnative"
18
+ }
19
+
20
+ compileSdkVersion safeExtGet('compileSdkVersion', 34)
21
+
22
+ defaultConfig {
23
+ minSdkVersion safeExtGet('minSdkVersion', 21)
24
+ targetSdkVersion safeExtGet('targetSdkVersion', 34)
25
+ }
26
+
27
+ lintOptions {
28
+ abortOnError false
29
+ }
30
+ }
31
+
32
+ repositories {
33
+ google()
34
+ mavenCentral()
35
+ }
36
+
37
+ dependencies {
38
+ implementation 'com.facebook.react:react-native:+'
39
+ }
@@ -0,0 +1 @@
1
+ <manifest />