apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.16k stars 988 forks source link

getPackageName returns the wrong bundleId #955

Open HarelM opened 4 years ago

HarelM commented 4 years ago

Bug Report

getPackageName returns the wrong bundle id when there's more than one target.

Problem

What is expected to happen?

getPackageName should return the "main" bundle id.

What does actually happen?

It doesn't return the "main" bundle if

Information

When using the following plugin: cc.fovea.cordova.openwith a new target is added and this complicates things. I've added console.log to the build.js code to make sure this is the behaviour I'm seeing. the following code returns an incorrect value:

const project = createProjectObject(projectPath, projectName);
const bundleIdentifier = project.getPackageName(); // returns com.myapp.shareextension instead of com.myapp

Command or Code

cordova plugin add cc.fovea.cordova.openwith cordova build ios

Environment, Platform, Device

ios, any.

Version information

Using the latest (as of writing these lines) code from master branch on github of this repository.

Checklist

Related to #953