Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Will Apple approve PWAs in Mac Store? #916

Closed
MarcellusMusic opened this issue Jun 29, 2020 · 21 comments · Fixed by pwa-builder/pwabuilder-MacOS#19
Closed

Will Apple approve PWAs in Mac Store? #916

MarcellusMusic opened this issue Jun 29, 2020 · 21 comments · Fixed by pwa-builder/pwabuilder-MacOS#19

Comments

@MarcellusMusic
Copy link

Question in detail
I am aware that Apple has updated their policies with regards to submitting web apps to Apple's app store. I am also aware that because of that, iOS packages are no longer available on the PWABuilder. However, I did notice that the PWABuilder still has an option to download a package for MacOS. I need to know if it is still possible to publish the desktop package to Apple's App store? Has anyone here recently submitted their MacOS PWABuilder package to the store and received approval?

@ghost
Copy link

ghost commented Jun 29, 2020

Hello MarcellusMusic, thank you for your interest in PWABuilder!

I have automatically added a "needs triage" label to help get things started. Our team will look into the question and answer ASAP. Other community members may also answer the question and provide feedback 🙌

@JudahGabriel
Copy link
Contributor

Hey Marcellus.

Yes, we haven't received signals against the MacOS App Store.

This month we'll be doing 2 things to help clarify:

  1. We're talking to Apple about PWAs in the iOS App Store. We'll raise also the issue of PWAs in the Mac Store.
  2. We're going to take an existing PWA and get it published into the Mac Store and see if we encounter any resistance.

@JudahGabriel JudahGabriel changed the title MacOS Packages [Question] Will Apple approve PWAs in Mac Store? Jul 2, 2020
@MarcellusMusic
Copy link
Author

Hi @JudahGabriel

Thank you for your reply. I would love to publish my PWA to the MacOS Store this month. After starting the registration process with Apple for a developer account, they asked for a fee, so I wanted to check with you guys first to see if they would even approve it. When will you know?

@JudahGabriel
Copy link
Contributor

Yes, Apple charges $99/year to publish in their app stores. (More precisely, they charge for their developer program, which enables app store publishing.)

No guarantees about all this. Apple may not give us a straight answer. We may hit slowdowns in publishing a PWA to the Mac Store. I'd recommend just going forward with your app. To my best knowledge, Apple won't reject your Mac app. If you do proceed, please post your results here.

@MarcellusMusic
Copy link
Author

Okay @JudahGabriel, I am proceeding with publishing to the app store.

There's one more thing I wanted to ask you. When I was working on my Windows Store PWA, I would check for the window.windows object while tailoring my app. Since I'm going to be tailoring the PWA for Mac OS, is there a similar method I can use to detect the standalone app using either PHP or Javascript?

@ThaDaVos
Copy link

ThaDaVos commented Jul 8, 2020

Hey all,

Sorry for commenting on this issue but it looks like some information I need is available here 😂

@MarcellusMusic - you mentioned something about PWA's directly in the App Store, right?
Any idea how?

I already got a PWA turned into an iOS package (back when the option was still available) and today I wanted to do it again to check if there are any updates to the generated package, as I'm having issues with high load times etc but I noticed the option is gone... then I found your issue and you mentioned changes about Apple's policies - any idea where I can find more information?

@ThaDaVos
Copy link

ThaDaVos commented Jul 8, 2020

Found my answer here: pwa-builder/PWABuilder-CLI#354 (comment)
And here: #799

@davrous
Copy link
Contributor

davrous commented Jul 8, 2020

Okay @JudahGabriel, I am proceeding with publishing to the app store.

There's one more thing I wanted to ask you. When I was working on my Windows Store PWA, I would check for the window.windows object while tailoring my app. Since I'm going to be tailoring the PWA for Mac OS, is there a similar method I can use to detect the standalone app using either PHP or Javascript?

I think we're using the default user agent string of the Apple WebView in our code, so I don't think you can easily guess your PWA is currently running as a Mac Store App. Why would you need to know this?

Adding @Rumsha7 who has built our platform. A possible solution would be to modify the customUserAgent property to add a specific filed like PWABuilderMacOS for instance to help you identifying the execution context.

@JudahGabriel
Copy link
Contributor

JudahGabriel commented Jul 8, 2020

to detect the standalone app using either PHP or Javascript

Can you clarify here? Are you trying to detect whether you're an installed app? Or whether you're on MacOS?

@MarcellusMusic
Copy link
Author

Hi All,

What I'm looking for is a simple way to detect if the user has launched the standalone PWA Builder App on macOS, so that I can run specific code and update the UI accordingly. This would allow me to tailor my app so that it does not feel like a duplicate of the other versions, but like a "real" macOS app.

@MarcellusMusic
Copy link
Author

MarcellusMusic commented Jul 8, 2020

Why would you need to know this?

So that I can easily run specific code and update the UI of my app accordingly.

@JudahGabriel
Copy link
Contributor

JudahGabriel commented Jul 11, 2020

Understood.

@Rumsha7 and @lee-leonardo is there a way to tell from JS whether you're running in the MacOS app? Specifically, @MarcellusMusic is asking,

When I was working on my Windows Store PWA, I would check for the window.windows object while tailoring my app. Since I'm going to be tailoring the PWA for Mac OS, is there a similar method I can use to detect the standalone app using Javascript?

@Rumsha7
Copy link
Contributor

Rumsha7 commented Jul 14, 2020

Thanks for the question! Yes, one way to tell whether a PWA is running on MacOS is through the following JS code:
if (navigator.appVersion.indexOf("Mac")!=-1) OSName="MacOS";
Reference: https://www.geeksforgeeks.org/how-to-detect-operating-system-on-the-client-machine-using-javascript/?ref=rp

Hope that helps!

@MarcellusMusic
Copy link
Author

MarcellusMusic commented Jul 14, 2020

Hi @Rumsha7 - Thank you for your reply! Awesome, the referenced code does tell me that I am running on macOS, but is there a way to tell if I'm running on both macOS && the PWABuilder app that I generated? I need to be able to do this as my UI will differ for the standalone macOS app. One idea was to check for the WKWebview object. Can you please confirm whether or not you guys are using WKWebView?

Thank you!

@Rumsha7
Copy link
Contributor

Rumsha7 commented Jul 14, 2020

Thank you for the clarification, @MarcellusMusic. Sorry I misunderstood your question earlier! Checking for WKWebView sounds like a good idea. I can confirm that we are using WKWebView (https://github.com/pwa-builder/pwabuilder-MacOS/blob/master/lib/assets/MacOSpwa/ViewController.swift).
Does that answer your question?

@MarcellusMusic
Copy link
Author

Hi @Rumsha7 - Yes, that does answer my question! I really appreciate the confirmation.

@JudahGabriel, now that I have more clarity, I'll continue with submitting my app to the app store. I'll post the results here soon!

Thank you!

@Rumsha7
Copy link
Contributor

Rumsha7 commented Jul 21, 2020

Great! Thanks, @MarcellusMusic!

@MarcellusMusic
Copy link
Author

Hi @Rumsha7, I wanted to quickly jump back in this thread because I'm encountering an error while running my app in Xcode:

Screen Shot 2020-07-25 at 6 38 30 PM

Could you please shed light on what is happening?

Thank you!

@Rumsha7
Copy link
Contributor

Rumsha7 commented Aug 3, 2020

Thanks for the question, @MarcellusMusic! Adding @lee-leonardo.

@lee-leonardo
Copy link
Contributor

lee-leonardo commented Aug 4, 2020

@MarcellusMusic
I have a fix that will add an error log and comment for the user so that they'll be be able to fix the issue.
Essentially what is happening is you are using an unsafe reference to a file that doesn't exist. The forced unwrap operator ! ignores the compiler directive to force the developer to safely check pointers (references, but same thing under the hood). Hence the run time error.

So there's a few ways to fix this issue, but essentially you will need to reintroduce the manifest.json file back into the application.

Also make sure that this line is the same folder path from the root of the project folder to the manifest file:
https://github.com/pwa-builder/pwabuilder-MacOS/blob/pwabuilder_issue916/lib/assets/MacOSpwa/ViewController.swift#L96

@MarcellusMusic
Copy link
Author

MarcellusMusic commented Aug 5, 2020

Understood.

I have reintroduced manifest.json back into the application and all is working for now.

@JudahGabriel,
Moving forward with publishing to the app store and I will post the results soon! Thank you!

@ghost ghost locked as resolved and limited conversation to collaborators Oct 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants