Skip to content

Commit

Permalink
Updated Gradle functionality to download AAR file for Android (#25)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
esgraham and esgraham13 authored Jan 30, 2020
1 parent ac80d4e commit 305c7b9
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ cognitiveservicesPlugin/.gradle/
cognitiveservicesPlugin/platforms/
cognitiveservicesPlugin/src/ios/MicrosoftCognitiveServicesSpeech.framework/
cognitiveservicesPlugin/aar
.vscode/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ npm i -g cordova
To include the wrapper for the Cognitive Services plugin as an observable, run the following command:

```bash
cp -r ../cognitiveservices ../examples/ionic-angular/node_modules/@ionic-native/
cp -r ../../cognitiveservices node_modules/@ionic-native/
```

While this should install all components, there have been a few changes to
Expand Down
17 changes: 16 additions & 1 deletion cognitiveservicesPlugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,21 @@ changed.

## Ionic Usage

## app.module.ts

```typescript
import { CognitiveServices } from '@ionic-native/cognitiveservices/ngx';

@NgModule({
declarations: [AppComponent],
entryComponents: [],
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule],
providers: [
...
CognitiveServices
]
```
## app.component.ts
```typescript
Expand All @@ -168,7 +183,7 @@ initializeApp() {
this.platform.ready().then(() => {
this.cognitiveServices.SetSubscription(
environment.subscriptionKey,
environment.cogServices.serviceRegion).then(
environment.serviceRegion).then(
() => { },
(error: any) => { alert(error); });
});
Expand Down
1 change: 0 additions & 1 deletion cognitiveservicesPlugin/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
</config-file>
<!-- your configuration elements, references, source files, etc... -->
<framework src="src/android/CognitiveServices.gradle" custom="true" type="gradleReference" />
<resource-file src="aar/client-sdk-1.8.0.aar" target="libs/client-sdk-1.8.0.aar" />
</platform>

<platform name="ios">
Expand Down
4 changes: 4 additions & 0 deletions cognitiveservicesPlugin/src/android/CognitiveServices.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ repositories{
flatDir {
dirs 'src/main/libs'
}
mavenCentral()
maven {
url "https://csspeechstorage.blob.core.windows.net/maven"
}
}

dependencies {
Expand Down

0 comments on commit 305c7b9

Please sign in to comment.