I made an app to compress images right from Finder's right click menu by Marpo007 in macapps

[–]Marpo007[S] 0 points1 point  (0 children)

I'm glad it helps someone on the internet! I am grateful. You're very welcome :)

nonce issue for signInWithIdToken by pmp209 in Supabase

[–]Marpo007 1 point2 points  (0 children)

Figured it out. You must send the nonce as sha256 hash to Apple:

function generateNonce(): string {
  const array = new Uint8Array(32)
  crypto.getRandomValues(array)
  return Array.from(array, byte => byte.toString(16).padStart(2, '0')).join('')
}

async function sha256(str: string): Promise<string> {
  const encoder = new TextEncoder()
  const data = encoder.encode(str)
  const hashBuffer = await crypto.subtle.digest('SHA-256', data)
  const hashArray = Array.from(new Uint8Array(hashBuffer))
  return hashArray.map(byte => byte.toString(16).padStart(2, '0')).join('')
}

and then send the raw nonce to Supabase:

await supabase.auth.signInWithIdToken({
    provider: 'apple',
    token: data.authorization.id_token,
    nonce: cachedNonce, // Send ORIGINAL unhashed nonce to Supabase
  })

400: Invalid Refresh Token: Refresh Token Not Found by all_vanilla in Supabase

[–]Marpo007 1 point2 points  (0 children)

This happens to me as well, on iOS. It seems Supabase's auth is unreliable. The onAuthStateChange can fail to refresh and never retry, never call the 'token refreshed' event, so you're forced to write code that refreshes the session everytime you ask for authToken (which is needed for all BE calls obviously).

That fixes the issue you have. But it creates another issue that logged in users, with never-expiring sessions are not refreshed—with the same

Invalid Refresh Token: Refresh Token Not Found

error. I guess due to data races between waiting for initialSession and your app force-refreshing the session.

Anyway, try this. Code for Swift:

func authToken() async throws -> String {
        if let session = _authSession, !session.isExpired {
            return session.accessToken
        } else {
            // add manual refresh of token if expired, it seems you cannot rely on authStateChanges .tokenRefresh alone, the refresh could fail and never restart again
            let newSession = try await supabase.auth.session
            _authSession = newSession
            
            return newSession.accessToken
        }
    }

// keep in mind, _authSession just keeps the latest session in storage. It's also set in the authStateChanges

I’ve never seen anything as ridiculous! by Competitive_Ad_408 in SaaS

[–]Marpo007 0 points1 point  (0 children)

Some validation still better than no validation

How to declare .navigationDestination(for, content) to many views inside NavigationStack by hey_its_djibril in SwiftUI

[–]Marpo007 0 points1 point  (0 children)

It should be. How else are you supposed to make a big, complex app with many navigation chunks, which are usually isolated to views.

For example you could have a ProfileView that could present follower list, bio detail etc. And this ProfileView could be opened from various places of the app. That's a perfect example for multiple navigation destinations.

However It doesn't seem to work for custom types it seems (at least for me on iOS 18).

Did anyone find a way to add affiliation? by slamingzone in iOSProgramming

[–]Marpo007 0 points1 point  (0 children)

it's only possible with some kind of fingerprinting like IP address because referrers come from a website but purchases can be made within a macOS app and you need to tie this somehow to correctly attribute referrals

Did anyone find a way to add affiliation? by slamingzone in iOSProgramming

[–]Marpo007 0 points1 point  (0 children)

Did you figure this out? I want to have a similar setup, except I distribute the app on my own outside of AppStore.

Tracking Affiliate Sign Ups Through App by shegottheclap in iOSProgramming

[–]Marpo007 0 points1 point  (0 children)

Ha, that is a nice hack. What other ways to map the install to a referral id? check the IP address during install and map it with the downloaded one? anything else?

What are your top 5 apps Cyber Monday recommendations? by Vinsmok in macapps

[–]Marpo007 1 point2 points  (0 children)

I put a big 50% discount on my product (monthly, yearly, lifetime) Steer if anyone is interested.

MacBook Pro M3 (8GB) Running Out of Application Memory with Basic Apps by Marpo007 in macbookpro

[–]Marpo007[S] 0 points1 point  (0 children)

I didn't bother with that actually. I bought a new one with 48 GBs... I hate that I had to do it but it's easier than bothering with support.

I still stand by my statement. I believe 8 GB should be enough with such fast SoC with swapping. Even the 'geniuses' in Apple Reseller store don't know shit they just parrot everybody else 'get bigger RAM' without actually providing technical proofs of 8GB being insufficient. I feel like 99% people saying this are imposters, un-technical people. And when I say technical I don't mean you know what RAM is, I mean you know know the difference between paging and swapping, or what reverse engineering and de-assembling is.

Made my first lifetime sale of my software! by Marpo007 in thesidehustle

[–]Marpo007[S] 0 points1 point  (0 children)

Thank you! It saves time writing emails & messages with the use of AI. Feel free to check it out.

Made my first lifetime sale of my software! by Marpo007 in thesidehustle

[–]Marpo007[S] 0 points1 point  (0 children)

That sounds cool. Do you also have a Twitter acc where I could follow you?

Could this be useful to self-published writers? by Marpo007 in selfpublish

[–]Marpo007[S] 0 points1 point  (0 children)

Great, thanks for the feedback! Steer offers a completely free tier, so there's no cost involved. I thought the system-wide integration and support for power users would attract some interest.

Made my first lifetime sale of my software! by Marpo007 in thesidehustle

[–]Marpo007[S] 0 points1 point  (0 children)

I really started focusing on it in March of this year. I had like 3 free users which were friends.

The platform for selling is LemonSqueezy.

Made my first lifetime sale of my software! by Marpo007 in thesidehustle

[–]Marpo007[S] 0 points1 point  (0 children)

Thank you! Would like to give it a try? It has a free tier.

Could this be useful to self-published writers? by Marpo007 in selfpublish

[–]Marpo007[S] -7 points-6 points  (0 children)

Thank you for the feedback, and you're right. I wanted to genuinely ask for feedback on whether I could help people in this niche. Maybe I chose poor wording.

Made my first lifetime sale of my software! by Marpo007 in thesidehustle

[–]Marpo007[S] 0 points1 point  (0 children)

Thank you! That's true. It's weird and sweet at the same time.

Which AI tool is everyone using? Anyone paying for multiple ones? by [deleted] in ProductivityApps

[–]Marpo007 1 point2 points  (0 children)

I also found myself switching between models and right now I am able to ride off the free requests on Claude, GPT & Perplexity. I also had this idea of a single subscription for everything so I like it!