-
Notifications
You must be signed in to change notification settings - Fork 535
Does this plugin work with Phonegap Build? #28
Comments
Referenced on Phonegap Build Community: |
Sorry for long answer. Never tried it with Phonegap Build, so can't tell. Entitlements file is generated by cordova hooks, that are in this plugin. So maybe they are not executed properly. Are there any build logs that can help? Also, entitlements file is stored in |
Regarding the link you provided. Well, there is another plugin, that had problems with Phonegap Build: nordnet/cordova-hot-code-push#68 . It is also on npm, uses cordova hooks and native code. But the problem was that Phonegap Build didn't include gradle files from the plugin. This was resolved by adding one line in projects So I would say, that plugin should be installed in your app, hooks should be executed. I'd suggest to check if UL really doesn't work by installing builded |
Hey @nikDemyankov Thank you for the reply! It's not working when I build it with Phonegap Build. When I open the .ipa and view the .app contents, I see that the plugin's JavaScript code is installed correctly, but I don't see any other entitlement files. When I test the .ipa on my iPhone 6 with iOS 9.2, links are not opening the app. I have Associated Domains in my provisioning profile. And I have an Another clue... When I tried to load the IPA to iTunes via Application Loader I got this error: ERROR ITMS-90046: "Invalid Code Signing Entitlements. Your application bundle's signature contains code signing entitlements that are not supported by iOS. Specifically, the value '*' for key 'com.apple.developer.associated-domains' in 'Payload/Vimify.app/Vimify' is not supported." It's like there are no associated domains are being added from the |
Also @nikDemyankov here is a link to my Phonegap Build Log: https://drive.google.com/file/d/0B8jgm2FTXgPSSkNaWURjcm4yeVE/view?usp=sharing Thank you! |
Thanks for the logs. I think I found the problem. According to the logs - PGB (Phonegap Build) doesn't execute plugins JS hooks. It installs the plugin, but after that - just builds the project. Normally in Cordova projects they are executed before the actual build. They task it to configure iOS project and generate entitlements file before the build. According to the comment from the question about PGB support for Cordova hooks we can see, that they doesn't support them. That's why no entitlements file is found. There are also similar requests in PGB: here and here. I'm afraid, there is nothing I can do about it: it's a PGB issue. Although, you can try to tweak it:
So, the idea is to manually create entitlements file and tell PGB to copy it in the project. Maybe this would work, because that is close to the thing, that hooks are doing. |
But this is iOS-only hack. |
I followed your instructions above. And built my IPA using PGB. I loaded my resulting IPA into this universal link validator: https://limitless-sierra-4673.herokuapp.com/ I get this errors:
Should I change the file name from Trying that now... |
Another problem is that PGB won't put the entitlements file at the root of the .IPA. It seems that the |
No, you don't have to change the name to If PGB doesn't support cordova hooks and there is no way to include custom resource files - then I guess there is nothing that can be done at the moment... |
Closing it, since this is a PGB issue, nothing can be done at the moment. |
@benmcmaster were you able to discover a workaround to get the plugin working with Build? |
@jskrepnek No. Not using Universal Links yet with my app. I just pointed all my links in emails and such to a redirect page that called a customURL. It's ghetto and one extra tap for the user... but it works for now. I am very close to just using Xcode to build my app. I am hoping PGB will add the features needed to get this working. |
Phonegap Build support now Cordova Hooks : Your plugin should be compatible with Phonegap Build |
@VanVan Do you mean that this plugin should just work in it's current state? Or is there any work that needs to be done? |
@benmcmaster I think it should work as it is. Only concern is that I had some reports, that PGB removes custom tags from the |
I would love to know if anyone has got this plugin working with PhoneGap Build? If so did you do anything special to get it working with iOS and Android? Thanks in advance. |
Hi, |
PhoneGap build needs to support this! We need a real answer why PGB wont support it. |
Any news ? |
Nope, I've just tried and it doesn't work with phonegap build system (and I'm using gradle, not PGB). I think the issue is that hooks are not supported in phonegap build. This is my config.xml: When I looked in the generated android manifest: What do the hooks do exactly? |
@yoav-zibin Hooks are used to generate platform-specific preferences depending on the things you define in For iOS:
For Android:
Sure, I think that can be done manually, although hooks are really simplifying developer's life :) But the problem with PGB is not only in the hooks. As I remember, it also removes custom tags from the Even if you configure everything manually - event is not gonna be triggered, unless you modify native code as well by defining urls in it. But yeah, everything can be done :) Although, it will require some hacking. |
@benmcmaster I mean Phonegap build support now everything needed for it to works, but there are some changes to do.
|
@VanVan That's encouraging! But, I don't quite understand your answer... Do you have this plugin working on your app built with PGB? Can you please share example config code? Thank you! |
I have discussed this with PGB support - they say, and might I add I understand, that they the see hooks as a Security risk for them as you could put anything in the Hooks that messe up the Build machine. |
@benmcmaster I didn't do the change needed.
If we look at cordova-universal-links-plugin/hooks/afterPrepareHook.js
If we look at cordova-universal-links-plugin/hooks/beforePluginInstallHook.js it seems to check dependency of
If we look at cordova-universal-links-plugin/hooks/iosBeforePrepareHook.js it seems related to .entitlements file. (not required for android) phonegap-plugin-push for example is compatible with phonegap build and removed hooks : Is there something on this plugin that can't be done without hooks on android ? I didn't look at .entitlements on ios, but is it really the only way to do ? |
same here, I am happy to test it as well.. Thanks in advance On Fri, Nov 4, 2016 at 1:27 PM, Yoav Zibin [email protected] wrote:
Kim Rasmussen |
@nikDemyankov for PGB build. I am happy to test. |
Understood, will do :) |
@nikDemyankov , I don't even need a doc if you have an example of a config.xml that's working on PGB :) |
I'm very happy to test |
Hi @nikDemyankov, did you get chance to work on this? |
Hi @simpleekare, |
No news? How can we help you? |
@maktibab didn't have time to work on any of the github stuff lately because of the releases at work. But now it's done, so was planning to start with PGB on UL plugin first this weekend, and then continue with CHCP plugin v2. Sorry for the delay, everyone... |
@nikDemyankov it's the better news I'have read from 2017! I will test your stuff as soon as I can. |
…l.json, and if it doesn’t exist - use preferences from config.xml as before. iOS only for now. #28
@nikDemyankov everythink is okay for a test? Or you need to do dev another. Do you have a doc to use? |
@maktibab In the last commit I've added code for iOS to load plugin's config from To test this instead of putting preferences in [{
"host": "domain.com",
"event": "general_event",
"path": [{
"url": "/first/path",
"event": "first_event_name"
}, {
"url": "/second/path"
}]
}] As you can see - it is similar to what we have right now in Now we need to understand how to put things in Also, they have messed it up a bit: these files should have extension So now the plan is:
The second one is the easiest :) One and three are the most painful since we don't have hooks support. |
You can do (3) like this: I used it to remove permissions I don't use like this: I'm not sure about (1), but I looked at a push-notification plugin that I use, and they pass the entitlement key in the .plist file like this: Note that Can you try that to see if it will work for (1)? |
@yoav-zibin not really. Your first link is to PGB configuration documentation. According to it you can specify additional preferences for app configuration files in your project's
So, we can't use that for About the second link - yes, you can add preferences to
That should work, but it feels like a hack. That's why I said that Let's say you had these preferences before in <universal-links>
<host name="mywebsite.com">
<path url="/first/path" event="first_event_name" />
<path url="/second/path" event="second_event_name" />
</host>
</universal-links>
<config-file target="*/Entitlements-Debug.plist" parent="com.apple.developer.associated-domains">
<array>
<string>applinks:mywebsite.com</string>
</array>
</config-file>
<config-file target="*/Entitlements-Release.plist" parent="com.apple.developer.associated-domains">
<array>
<string>applinks:mywebsite.com</string>
</array>
</config-file>
[{
"host": "mywebsite.com",
"path": [{
"url": "/first/path",
"event": "first_event_name"
}, {
"url": "/second/path",
"event": "second_event_name"
}]
}]
<plugin spec="https://github.com/YOUR_ACCOUNT_NAME/cordova-universal-links-plugin.git" source="git" />
|
I'm not sure you have to fork: you can pass parameters to the plugin, and then use them in plugin.xml like this: The most common use case is just have a single universal link that you want to handle, e.g., for me it's |
@yoav-zibin yes, but the problem is not in passing parameters to the plugin. The problem is that we need to add some preferences to the native config - Right now for non-PGB projects this is handled by the plugin's JS hooks: when you build the project - they generate this |
@nikDemyankov I have try the fork solution. Not yet working on android and ios. On Android after pgb generate the apk file, I did not find some intent reference in the AndroidManifest.xml. Do I miss something? |
At the moment fork solution is only for iOS. Wanted to test it first.
It should not be in the
That folder is generated by the plugin's JS hooks. And it's just for developer's convenience so he/she would not need to generate |
Only info.plist found in the ipa file generated by PGB :( |
@maktibab Okay, thanks for testing, I'll see what can be done. |
@nikDemyankov some news about this issue? |
@maktibab no, sorry, didn't have time to do anything lately... I'm really struggling right now with supporting plugins. |
For those working on a stopgap or the permanent fix, there are going to be some obstacles for iOS. This is the most recent reference I can offer: https://forums.adobe.com/thread/2290461 |
👋 Hi! Thank you for your interest in this repo. 😢 We are not using nordnet/cordova-universal-links-plugin anymore, and we lack the manpower and the experience needed to maintain it. We are aware of the inconveniece that this may cause you. Feel free to use it as is, or create your own fork. 🔒 This will now be closed & locked. ℹ️ Please see #160 for more information. |
I can't seem to get this to work for Phonegap Build for iOS 9.2. Are the entitlements getting set correctly with PGB?
When I add my .ipa file into
https://limitless-sierra-4673.herokuapp.com/
it complains: Must be able to find entitlements. I looked and there is no archived-expanded-entitlements.xcent at the root of the app contents.
Has anyone got it to work with Phongap Build. Or am I missing something?
The text was updated successfully, but these errors were encountered: