Skip to content

Instantly share code, notes, and snippets.

View maiconcarraro's full-sized avatar
🇧🇷

Maicon Carraro maiconcarraro

🇧🇷
View GitHub Profile
@maiconcarraro
maiconcarraro / SubscribeButton.tsx
Last active August 14, 2024 17:54
PWABuilder iOS shell + React example
export default function SubscribeButton() {
const [subscribing, setSubscribing] = useState<boolean>(true);
const [token, setToken] = useState<string | null>(null);
const [iOSPushCapability, setiOSPushCapability] = useState(false);
const saveFCMToken = api.user.saveFCMToken.useMutation({ // I'm using tRPC
onSuccess() {
setSubscribing(false);
toast.success("Success.");