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

Renamed iOS plugin module #5

Merged
merged 16 commits into from
Nov 27, 2024
Merged
12 changes: 5 additions & 7 deletions .github/workflows/OnNPM.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Publish Expo plugin - NPM Repo
'on':
push:
branches:
- master
- main
paths:
- package.json
workflow_dispatch: null
Expand Down Expand Up @@ -38,14 +38,14 @@ jobs:
- name: Collect dependencies
run: |
npm install
npm run build

- name: Publish
run: |
npm run prepack
# npm run prepack
npm publish --access public
env:
NODE_AUTH_TOKEN: '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'
# ${{secrets.NPM_TOKEN}}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

- name: Create a GitHub release
uses: ncipollo/release-action@v1
Expand All @@ -62,8 +62,6 @@ jobs:
steps:
- name: Check out Git repository
uses: actions/checkout@v2
with:
token: ${{ secrets.HELPER_TOKEN }}

- name: 'Use Node.js'
uses: actions/setup-node@v4
Expand All @@ -90,7 +88,7 @@ jobs:
- name: Config git
run: |
git config user.name "wgsadmin"
git config user.email "operations@webgeoservices.com"
git config user.email "operations@woosmap.com"

- name: Push CHANGELOG.md
run: |
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/predict_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: PR Checker
on:
pull_request:
branches:
- 'master'
- 'main'
types: [labeled, opened, synchronize]
workflow_dispatch:

Expand Down Expand Up @@ -114,15 +114,13 @@ jobs:
run: |
echo "::error::You have miss to update whatsnew.md with latest changes"
exit 1

- name: 'Update version'
if: ${{ steps.check_pr_labels_major.outputs.passed }} == true
run: |
sed -i "3 s/.*/\t\"version\":\"${{ env.PLUGIN_VERSION }}\",/" package.json
_versionupdate="export const pluginVersion = '${{ env.PLUGIN_VERSION }}';"
sed -i "1 s/.*/${_versionupdate}/" src/Component/Internal/Constants.tsx
cat package.json

- name: Commit and push changes
if: ${{ steps.check_pr_labels_major.outputs.passed }} == true
uses: devops-infra/action-commit-push@master
Expand Down Expand Up @@ -160,7 +158,8 @@ jobs:

- name: Run test
run: |
npm test
npm run build
#npm test
#yarn example run ios

# react_android:
Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ __tests__
/android/build/
/example/
/src/
android/.gradle/
2 changes: 1 addition & 1 deletion expo-module.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
],
"apple": {
"modules": [
"WoosmapExpoPluginGeofencingBatchModule"
"ExpoPluginGeofencingBatchModule"
],
"appDelegateSubscribers": ["WoosmapGeofencingAppDelegate"]
},
Expand Down
50 changes: 42 additions & 8 deletions ios/GeofencingEventsReceiver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,49 @@ class GeofencingEventsReceiver: NSObject {

if let POI = POIs.getPOIbyIdStore(idstore: POIregion.identifier) as POI? {
eventAttributes.put(POI.name ?? "-", forKey: "name")
eventAttributes.put(POI.idstore ?? "-", forKey: "idStore")
eventAttributes.put(POI.city ?? "-", forKey: "city")
eventAttributes.put(POI.zipCode ?? "-", forKey: "zipCode")
let idstore = POI.idstore ?? "-"
if(idstore.trimmingCharacters(in: .whitespacesAndNewlines) != ""){
eventAttributes.put(idstore, forKey: "idStore")
}

let city = POI.city ?? "-"
if(city.trimmingCharacters(in: .whitespacesAndNewlines) != ""){
eventAttributes.put(city, forKey: "city")
}

let zipCode = POI.zipCode ?? "-"
if(zipCode.trimmingCharacters(in: .whitespacesAndNewlines) != ""){
eventAttributes.put(zipCode, forKey: "zipCode")
}

eventAttributes.put(POI.distance, forKey: "distance")
eventAttributes.put(POI.countryCode ?? "-", forKey: "country_code")
eventAttributes.put(POI.address ?? "-", forKey: "address")
eventAttributes.put(POI.tags ?? "-", forKey: "tags")
eventAttributes.put(POI.types ?? "-", forKey: "types")
POI.user_properties.forEach { eventAttributes.put("user_properties.\($0.value as? String ?? "-")", forKey: $0.key) }

let countryCode = POI.countryCode ?? "-"
if(countryCode.trimmingCharacters(in: .whitespacesAndNewlines) != ""){
eventAttributes.put(countryCode, forKey: "country_code")
}

let address = POI.address ?? "-"
if(address.trimmingCharacters(in: .whitespacesAndNewlines) != ""){
eventAttributes.put(address, forKey: "address")
}

let tag : String = POI.tags ?? "-"
if(tag.trimmingCharacters(in: .whitespacesAndNewlines) != ""){
eventAttributes.put(tag, forKey: "tags")
}

let types : String = POI.types ?? "-"
if(types.trimmingCharacters(in: .whitespacesAndNewlines) != ""){
eventAttributes.put(types, forKey: "types")
}

POI.user_properties.forEach {
let keyValue = $0.value as? String ?? "-"
if(keyValue.trimmingCharacters(in: .whitespacesAndNewlines) != ""){
eventAttributes.put(keyValue, forKey: "user_properties.\($0.key)")
}
}
}

BatchProfile.trackEvent(name: batchEventName,attributes:eventAttributes)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@woosmap/expo-plugin-geofencing-batch",
"version": "0.1.1",
"version":"0.2.0",
"description": "Woosmap geofencing and batch integration",
"main": "build/index.js",
"types": "build/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion whatsnew.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* enhancement: Expo integration for Woosmap geofencing and batch
* publish: Expo integration for Woosmap geofencing and batch