Skip to content

Commit 305c7b9

Browse files
esgrahamesgraham13
andauthored
Updated Gradle functionality to download AAR file for Android (#25)
* Added plugin and native ionic code * Removed the cognitive services plugin .DS_Store file from gitignore, and added all .DS_Store files. * Renamed Native Ionic Folder. Updated Readme. * Added images for README * Renamed cognitiveservicesPlugin folder * Updated Android source to download aar file using gradle, rather than including aar file in code. * Remove vscode files. Co-authored-by: esgraham13 <[email protected]>
1 parent ac80d4e commit 305c7b9

File tree

5 files changed

+22
-3
lines changed

5 files changed

+22
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ cognitiveservicesPlugin/.gradle/
44
cognitiveservicesPlugin/platforms/
55
cognitiveservicesPlugin/src/ios/MicrosoftCognitiveServicesSpeech.framework/
66
cognitiveservicesPlugin/aar
7+
.vscode/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ npm i -g cordova
9494
To include the wrapper for the Cognitive Services plugin as an observable, run the following command:
9595

9696
```bash
97-
cp -r ../cognitiveservices ../examples/ionic-angular/node_modules/@ionic-native/
97+
cp -r ../../cognitiveservices node_modules/@ionic-native/
9898
```
9999

100100
While this should install all components, there have been a few changes to

cognitiveservicesPlugin/README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,21 @@ changed.
156156

157157
## Ionic Usage
158158

159+
## app.module.ts
160+
161+
```typescript
162+
import { CognitiveServices } from '@ionic-native/cognitiveservices/ngx';
163+
164+
@NgModule({
165+
declarations: [AppComponent],
166+
entryComponents: [],
167+
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule],
168+
providers: [
169+
...
170+
CognitiveServices
171+
]
172+
```
173+
159174
## app.component.ts
160175
161176
```typescript
@@ -168,7 +183,7 @@ initializeApp() {
168183
this.platform.ready().then(() => {
169184
this.cognitiveServices.SetSubscription(
170185
environment.subscriptionKey,
171-
environment.cogServices.serviceRegion).then(
186+
environment.serviceRegion).then(
172187
() => { },
173188
(error: any) => { alert(error); });
174189
});

cognitiveservicesPlugin/plugin.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
</config-file>
3434
<!-- your configuration elements, references, source files, etc... -->
3535
<framework src="src/android/CognitiveServices.gradle" custom="true" type="gradleReference" />
36-
<resource-file src="aar/client-sdk-1.8.0.aar" target="libs/client-sdk-1.8.0.aar" />
3736
</platform>
3837

3938
<platform name="ios">

cognitiveservicesPlugin/src/android/CognitiveServices.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ repositories{
33
flatDir {
44
dirs 'src/main/libs'
55
}
6+
mavenCentral()
7+
maven {
8+
url "https://csspeechstorage.blob.core.windows.net/maven"
9+
}
610
}
711

812
dependencies {

0 commit comments

Comments
 (0)